View gist:e333d7af94989b10887e55da9bbdfa4d
Use canvas drawImage to clip and scale. MDN docs are confusing as hell, this is simple:
View gist:4148d94cfedcaf517f7ca5083a4b2252
Comcast has just announced that in November, they will be implementing a 1 terabyte monthly data cap on all customers in the San Francisco area. Customers that go over that amount will automatically be billed an additional $200 "no matter how much data is used" plus another $10 per additional 50 gigabytes used. This is price gouging and abusive to customers who have no other options.
I live in San Francisco somewhat close to downtown. In my personal case, on *average* I use 200-250gb per month. However, since I am a software engineer professionally and a heavy user of my home internet connection, there are some months where I have extremely high usage and can quite easily almost hit that 1tb mark or go over. This can happen if I am having to download a lot of software for projects like Linux installs, related media files, etc. So do simply to do my job, my previously unlimited connection that rarely may go over 1tb will now cost me hundreds of dollars extra a month unexpectedly.
To go further, I do not curr
View gist:8b1b2ea57d7f9a9ae22f80d4fbf5b97f
// Run from the dev tools console of any Youtube video
// Accurate as of June 23, 2017.
// ES6 version
const videoUrls = ytplayer.config.args.adaptive_fmts
.map(item => item
.reduce((prev, curr) => (curr = curr.split('='),
Object.assign(prev, {[curr[0]]: decodeURIComponent(curr[1])})
View Flexbox things
# 3 columns, center column wraps to content width, outer columns grow dynamically
View gist:c671651028d65e329dcd
"env": {
"browser": 1,
"node": 1
"globals": {
"jQuery": 1,
"$": 1,
"_gaq": 1,
"_ga": 1,
View gist:7d822839a0ea95c8d9b4
alias kube='kubectl -n=live -l owner=apps'
for p in $(kubectl -n=live get pods | grep -i "$1" | cut -f 1 -d ' '); do
str="$str kubectl -n=live logs -f $p;"
eval $str
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 CreateDesktop false && killall Finder
# Show
defaults write CreateDesktop true && killall Finder
View gist:1489bbd1a8e47e86db38
# 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
@-webkit-keyframes blink {
90% { opacity: 1; }
100% { opacity: 0; }
@-moz-keyframes blink {
90% { opacity: 1; }
100% { opacity: 0; }
@-o-keyframes blink {