Skip to content
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"
View labler.js
/* Scans Gmail inbox for new GitHub notifications and:
*
* - labels threads that @-mention me with "Direct Mention";
* - labels threads for issues/PRs that I've opened with "Direct Mention";
* - labels threads that @-mention my teams with "Team Mention".
*
* To install: visit https://script.google.com/intro to enable Apps Script.
* Then copy this script over, edit the first few regular expressions. You'll
* have to allow Apps Script access to your Gmail. Finally, use the time icon
* in the menubar to create a trigger that will run `processInbox` at scheduled
View .gitconfig
[user]
name = Mislav Marohnić
email = mislav.marohnic@gmail.com
[color]
ui = true
[push]
default = simple
Something went wrong with that request. Please try again.