Direct copy of pre-encoded file:
$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8
| { | |
| "USD": { | |
| "symbol": "$", | |
| "name": "US Dollar", | |
| "symbol_native": "$", | |
| "decimal_digits": 2, | |
| "rounding": 0, | |
| "code": "USD", | |
| "name_plural": "US dollars" | |
| }, |
| import CryptoJS from 'crypto-js' | |
| export function AES_encrypt(message: string, key: string): string { | |
| const salt = CryptoJS.lib.WordArray.random(256) | |
| const iv = CryptoJS.lib.WordArray.random(16) | |
| const keyHash = CryptoJS.PBKDF2(key, salt, { | |
| hasher: CryptoJS.algo.SHA512, | |
| keySize: 64 / 8, | |
| iterations: 999, |
| #!/bin/bash | |
| while [[ true ]]; do | |
| video_url="" | |
| audio_format="" | |
| audio_quality="" | |
| read -p "Enter youtube video URL: " video_url | |
| if [[ -z "${video_url}" ]]; then |
| <?php | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, 'your_api_url'); | |
| // custom HTTP method: GET, POST, PUT, DELETE | |
| curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); | |
| curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); | |
| curl_setopt($ch, CURLOPT_HTTPHEADER, [ |
Direct copy of pre-encoded file:
$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8
| <xf:js> | |
| $(document).ready(function() { | |
| $('.calvingDateBtn').on('click', function(e) { | |
| e.preventDefault(); | |
| var $input = $('#calvingDateInput'), | |
| $result = $('#calvingDateDue'); | |
| if ($(e.currentTarget).data('reset')) { | |
| $input.val(''); | |
| $result.text(''); | |
| <?php | |
| class Encrypter | |
| { | |
| const METHOD = 'AES-256-CBC'; | |
| public static function encrypt(array $payload, $key) | |
| { | |
| $key = md5($key, true); |
| <?php | |
| /** | |
| * simple method to encrypt or decrypt a plain text string | |
| * initialization vector(IV) has to be the same when encrypting and decrypting | |
| * | |
| * @param string $action: can be 'encrypt' or 'decrypt' | |
| * @param string $string: string to encrypt or decrypt | |
| * | |
| * @return string | |
| */ |
A pattern for recursion with Promises - in this example, walking a directory structure.
readDirRecursive() is called with a starting directory and will itself return a Promise.readDir() is called and passed starting directory.getItemList() as a Promise, which in turn is chained to getItemListStat() to stat each item to determine if file or directory.processItemList():
fileList array.readDirQueue.| <?php | |
| abstract class BaseDoc { | |
| /** | |
| * @param SomeObject1 $argument1 | |
| * @param SomeObject2 $argument2 | |
| */ | |
| public function exampleFunc($argument1, $argument2) { | |
| } |