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" | |
| }, |
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
| <?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.| server { | |
| listen 80 default_server; | |
| server_name example.com www.example.com; | |
| access_log /srv/www/example.com/logs/access.log; | |
| error_log /srv/www/example.com/logs/error.log; | |
| root /srv/www/example.com/public; | |
| index index.php index.html; |
| #!/bin/bash | |
| # bash generate random alphanumeric string | |
| # | |
| # bash generate random 32 character alphanumeric string (upper and lowercase) and | |
| NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
| # bash generate random 32 character alphanumeric string (lowercase only) | |
| cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
| # | |
| # Ubuntu Node.js Dockerfile | |
| # | |
| # https://github.com/dockerfile/ubuntu/blob/master/Dockerfile | |
| # https://docs.docker.com/examples/nodejs_web_app/ | |
| # | |
| # Pull base image. | |
| FROM ubuntu:14.04 |
| <?php | |
| /** | |
| * getRandomWeightedElement() | |
| * Utility function for getting random values with weighting. | |
| * Pass in an associative array, such as array('A'=>5, 'B'=>45, 'C'=>50) | |
| * An array like this means that "A" has a 5% chance of being selected, "B" 45%, and "C" 50%. | |
| * The return value is the array key, A, B, or C in this case. Note that the values assigned | |
| * do not have to be percentages. The values are simply relative to each other. If one value | |
| * weight was 2, and the other weight of 1, the value with the weight of 2 has about a 66% | |
| * chance of being selected. Also note that weights should be integers. |
| change owner of brew to root, which is common for files in /usr/local directory ( opposed to either /home or /Users ) | |
| sudo chown root /usr/local/bin/brew | |
| and/or add the admin group | |
| sudo chown root:admin /usr/local/bin/brew | |
| sudo brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-openssl --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools --with-x265 --with-faac --with-lame --with-x264 --with-xvid |
| javascript | |
| ES6ValidationInspection | |
| JSAccessibilityCheckInspection | |
| JSBitwiseOperatorUsageInspection | |
| JSCheckFunctionSignaturesInspection | |
| JSClosureCompilerSyntaxInspection | |
| JSCommentMatchesSignatureInspection | |
| JSComparisonWithNaNInspection | |
| JSConsecutiveCommasInArrayLiteralInspection |