What do you want to save?
Add Code snippet
New code examples
-
Swift 2021-09-05 12:08:01
swift 5 only the day number from date
let dateString = "2018-12-24 18:00:00 UTC" let formatter = DateFormatter() formatter.dateFormat = "yyyy-MM-dd HH:mm:ss 'UTC'" guard let date = formatter.date(from: dateString) else { return } formatter.... Add solution -
PHP 2021-09-05 00:51:02
gform french phone regex
/** this code is used for wordpress plugin "gravity form"*/ /** Put this code on you're function.php file theme */ add_filter( 'gform_phone_formats', 'fr_phone_format' ); function fr_phone_format( $phone_formats ) { $phone_for... Add solution -
Javascript 2021-09-04 22:51:02
js datetime format
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; var today = new Date(); console.log(today.toLocaleDateString("en-US")); // 9/17/2016 console.log(today.toLocaleDateString("en-US", options)); // Satur... Add solution -
Python 2021-09-04 21:58:03
how to record a wav file using python
import pyaudio import wave # the file name output you want to record into filename = "recorded.wav" # set the chunk size of 1024 samples chunk = 1024 # sample format FORMAT = pyaudio.paInt16 # mono, change to 2 if you want stereo channels = 1 #... Add solution -
Javascript 2021-09-03 17:59:02
compress image javascript
//========= Step 1 - Client Side Compression =========== //Images Objects var source_img = document.getElementById("source_img"), target_img = document.getElementById("target_img"); //(NOTE: see the examples/js/demo.js file to un... Add solution -
PHP 2021-09-03 15:51:05
php in javascript
If your whole JavaScript code gets processed by PHP, then you can do it just like that. If you have individual .js files, and you don't want PHP to process them (for example, for caching reasons), then you can just pass variables around in JavaScript. F... Add solution