View update.sh
#!/bin/bash
set -e
cd "${0%/*}"
export GEM_HOME="${PWD}/.gem"
export GEM_PATH="$GEM_HOME"
if [ ! -x "${GEM_HOME}/bin/grailbird_updater" ]; then
/usr/bin/gem install grailbird_updater --no-rdoc --no-ri
fi
View netflix.sh
#!/bin/bash
set -e
droplet=netflix
interface=Wi-Fi
us_regions=( nyc1 nyc2 nyc3 )
random_region() {
echo ${us_regions[RANDOM % ${#us_regions[@]}]}
}
View git-recently-checkout-branches.sh
#!/bin/bash
set -e
git reflog -n100 --pretty='%cr|%gs' --grep-reflog='checkout: moving' HEAD | {
seen=":"
git_dir="$(git rev-parse --git-dir)"
while read line; do
date="${line%%|*}"
branch="${line##* }"
if ! [[ $seen == *:"${branch}":* ]]; then
View poor_promise.js
/* PoorPromise is reasonably compatible with ES6 Promise specification.
* The goal of this implementation was shortness while not sacrificing readability.
* This clocks at around 100 LoC, while the es6-promise implementation is 500+ lines.
*/
(function() {
var flushLevel = 0
// Ensures that nested callbacks are all flushed within one "tick"
function flush(callback, flushing) {
if (flushing === undefined) flushing = flushLevel > 0
View spotify-remote-patch.sh
#!/bin/bash
# Run once to patch `rcd` daemon after creating a backup.
# Run again to restore the backup and revert back to original functionality.
set -eu
if [ "$USER" != "root" ]; then
exec sudo "$0" "$@"
fi
rcd="/System/Library/CoreServices/rcd.app/Contents/MacOS/rcd"
View setTimeout.js
(function(){
var _ = window.setTimeout
window.setTimeout = function(delay, fn) {
return (typeof delay == "number") ? _(fn, delay) : _(delay, fn)
}
})()
View licenses-api.sh
$ curl -s -H 'Accept: application/vnd.github.drax-preview+json' \
https://api.github.com/orgs/github/repos?per_page=100 | \
grep -A1 '"license"' | grep '"key"' | cut -d'"' -f4 | \
sort | uniq -c
5 apache-2.0
1 bsd-3-clause
2 cc0-1.0
1 gpl-2.0
56 mit
View license-audit.sh
#!/bin/bash
# Usage: license-audit [<project-dir>]
#
# Scans gems from the current project's bundle, Bower components and npm
# packages, and prints their license.
#
# Requires:
# - licensee >= 4.5.0
# - ruby with Bundler (for Gemfiles)
set -e
View rbenv-forks.tsv
repo stars created updated authors
yyuu/pyenv 3592 2012-08-31 2015-12-23 @yyuu (136), @joshfriend (41), @makotosasaki (31), @blueyed (30), @jasonkarns (12)
gcuisinier/jenv 904 2013-01-24 2015-12-23 @gcuisinier (56)
CHH/phpenv 426 2011-08-05 2015-04-14 @CHH (54)
riywo/anyenv 368 2013-06-11 2015-12-24 @riywo (14)
tokuhirom/plenv 275 2010-03-20 2015-12-11 @tokuhirom (188)
kylef/swiftenv 211 2015-12-15 2015-12-24 @kylef (67)
riywo/ndenv 143 2013-06-20 2015-10-28 @riywo (6)
mururu/exenv 138 2012-11-10 2015-09-28 @mururu (6)
OiNutter/nodenv 125 2013-03-10 2015-12-04 @jasonkarns (29), @OiNutter (22)
View Gemfile
source "https://rubygems.org"
gem "minitest"
gem "rspec"