View gist:8b1b2ea57d7f9a9ae22f80d4fbf5b97f
// Run from the dev tools console of any Youtube video
// Accurate as of June 12, 2016
var videoUrls = {};
ytplayer.config.args.url_encoded_fmt_stream_map.split(',').forEach(function (item) {
var obj = {};
item.split('&').forEach(function (param) {
param = param.split('=');
obj[param[0]] = decodeURIComponent(param[1]);
});
View Flexbox things
# 3 columns, center column wraps to content width, outer columns grow dynamically
http://codepen.io/anon/pen/ZWMMaX
View gist:6a46f9c8f1bb9432949dee87ba7046b3
'use strict';
let ob = require('massdrop-util/obfuscatedInteger');
console.log(ob.make(1942418));
View gist:c671651028d65e329dcd
{
"env": {
"browser": 1,
"node": 1
},
"globals": {
"jQuery": 1,
"$": 1,
"_gaq": 1,
"_ga": 1,
View gist:7d822839a0ea95c8d9b4
# remove all rem() in a file
sed -Ei '' "s/rem\(([^()]*)\)/\1/g"
find . -name '*.scss' | xargs sed -Ei '' "s/rem\(([^()]*)\)/\1/g"
# git grep file name and open with xcode (or other program)
git grep 'search terms' | awk '{print $1}' | xargs xed
# replace all tabs with double spaces
git grep --name-only '^'$'\t\t' | xargs sed -i '' "s/$(printf '\t')/ /g"
View gist:460056be4527ef98db74
# update all submodules
git config --global alias.subupdate 'submodule update --init --recursive'
# checkout a branch in each submodule and update it
git config --global alias.subpull = submodule foreach git pull origin production
# show aliases
git config --global alias.alias '!git config -l | grep alias | cut -c 7-'
View gist:bfe457b0eecefaff5d8d
# Hide
defaults write com.apple.finder CreateDesktop false && killall Finder
# Show
defaults write com.apple.finder CreateDesktop true && killall Finder
View gist:1489bbd1a8e47e86db38
#!/bin/sh
# Run changed javascript files through jshint before commiting and prevent bad
# code from being committed.
# If you need to prevent newly added js from being checked because its in a
# library like bower_components, add a .jshintignore file and list the directory
# INSTALL: Add as a file in your repo as .git/hooks/pre-commit
FILES=$(git diff --cached --name-only --diff-filter=ACM| grep ".js$")
if [ "$FILES" = "" ]; then
exit 0
View gist:5c8867fa72fa4275ae44
CSS:
@-webkit-keyframes blink {
90% { opacity: 1; }
100% { opacity: 0; }
}
@-moz-keyframes blink {
90% { opacity: 1; }
100% { opacity: 0; }
}
@-o-keyframes blink {
View code-review-checklist.md
  • readability
  • maintainability
  • consistency
  • exception handling
  • simplicity
  • test coverage
  • side effect
  • reuse of existing code
  • performance