| Parameter | YouTube recommends setting |
|---|---|
| -movflags faststart | moov atom at the front of the file (Fast Start) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Streamlined Shopify theme development. | |
| NOTE: depends on module gulp-shopify-theme | |
| npm install --save-dev yargs gulp gulp-sass gulp-changed gulp-sourcemaps gulp-autoprefixer gulp-uglify gulp-concat gulp-replace gulp-plumber gulp-babel browser-sync gulp-if del gulp-add-src gulp-rename gulp-yaml gulp-shopify-theme | |
| Highlights: | |
| - https proxying via BrowserSync |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Bonfire: Find the Longest Word in a String | |
| // Author: @mike3run | |
| // Challenge: http://www.freecodecamp.com/challenges/bonfire-find-the-longest-word-in-a-string?solution=function%20findLongestWord(str)%20%7B%0A%20%20var%20array%20%3D%20str.split(%27%20%27)%3B%0A%20%20var%20arrayLength%20%3D%20array.length%3B%0A%20%20var%20numeros%20%3D%20%5B%5D%3B%0A%20%20for%20(i%20%3D%200%3B%20i%3C%20arrayLength%20%3B%20i%2B%2B)%7B%0A%20%20%20%20var%20conteo%20%3D%20array%5Bi%5D.length%3B%0A%20%20%20%20numeros.push(conteo)%3B%0A%20%20%7D%0A%20%20return%20Math.max.apply(%20Math%2C%20numeros%20)%3B%0A%7D%0A%0AfindLongestWord(%22The%20quick%20brown%20fox%20jumped%20over%20the%20lazy%20dog%22)%3B%0A | |
| // Learn to Code at Free Code Camp (www.freecodecamp.com) | |
| function findLongestWord(str) { | |
| var array = str.split(' '); | |
| var arrayLength = array.length; | |
| var numeros = []; | |
| for (i = 0; i< arrayLength ; i++){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Bonfire: Check for Palindromes | |
| // Author: @mike3run | |
| // Challenge: http://www.freecodecamp.com/challenges/bonfire-check-for-palindromes?solution=function%20palindrome(str)%20%7B%0A%20%20%2F%2F%20Good%20luck!%0A%20%20var%20min%20%3D%20str.toLowerCase().replace(%2F%5Cs%2B%2Fg%2C%20%27%27).replace(%2F%5B.%2C-%5C%2F%23!%24%25%5C%5E%26%5C*%3B%3A%7B%7D%3D%5C-_%60~()%5D%2Fg%2C%22%22)%3B%0A%20%20var%20inv%20%3D%20min.split(%27%27).reverse().join(%27%27)%3B%0A%20%20%0A%20%20if%20(min%20%3D%3D%3D%20inv)%20%7B%0A%20%20%20%20return%20true%3B%0A%20%20%7Delse%20%7B%0A%20%20%20%20return%20false%3B%0A%20%20%7D%0A%7D%0A%0A%0A%0Apalindrome(%22A%20man%2C%20a%20plan%2C%20a%20canal.%20Panama%22)%3B%0A | |
| // Learn to Code at Free Code Camp (www.freecodecamp.com) | |
| function palindrome(str) { | |
| // Good luck! | |
| var min = str.toLowerCase().replace(/\s+/g, '').replace(/[.,-\/#!$%\^&\*;:{}=\-_`~()]/g,""); | |
| var inv = min.split('').reverse().join(''); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # first: | |
| lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
| sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
| # To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
| # go to /usr/local/lib and delete any node and node_modules | |
| cd /usr/local/lib | |
| sudo rm -rf node* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // vanilla JS window width and height | |
| var w=window, | |
| d=document, | |
| e=d.documentElement, | |
| g=d.getElementsByTagName('body')[0], | |
| x=w.innerWidth||e.clientWidth||g.clientWidth, | |
| y=w.innerHeight||e.clientHeight||g.clientHeight; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Sample JavaScript file added with ScriptTag resource. | |
| This sample file is meant to teach best practices. | |
| Your app will load jQuery if it's not defined. | |
| Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7. | |
| Your app does not change the definition of $ or jQuery outside the app. | |
| Example: if a Shopify theme uses jQuery 1.4.2, both of these statements run in the console will still return '1.4.2' | |
| once the app is installed, even if the app uses jQuery 1.9.1: | |
| jQuery.fn.jquery => "1.4.2" | |
| $.fn.jquery -> "1.4.2" | |
| */ |
Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.
cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Annoying.js - How to be an asshole to your users | |
| * | |
| * DO NOT EVER, EVER USE THIS. | |
| * | |
| * Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com) | |
| * Visit https://gist.github.com/767982 for more information and changelogs. | |
| * Licensed under the MIT license. http://www.opensource.org/licenses/mit-license.php | |
| * | |
| */ |