View licenses-api.sh
1 2 3 4 5 6 7 8 9 10
$ 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
1 2 3 4 5 6 7 8 9 10
#!/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
1 2 3 4 5 6 7 8 9 10
repo stars created updated authors
yyuu/pyenv 2578 2012-08-31 2015-05-18 @yyuu (59), @makotosasaki (31), @blueyed (23), @joshfriend (21)
gcuisinier/jenv 637 2013-01-24 2015-04-03 @gcuisinier (55)
CHH/phpenv 381 2011-08-05 2015-04-14 @CHH (54)
tokuhirom/plenv 253 2010-03-20 2015-03-20 @tokuhirom (188)
riywo/anyenv 240 2013-06-11 2015-05-14 @riywo (14)
riywo/ndenv 109 2013-06-20 2015-03-21 @riywo (6)
mururu/exenv 75 2012-11-10 2014-06-15 @mururu (6)
wfarr/goenv 64 2013-06-15 2015-03-27 @wfarr (7)
OiNutter/nodenv 61 2013-03-10 2015-03-16 @OiNutter (20)
View Gemfile
1 2 3 4
source "https://rubygems.org"
 
gem "minitest"
gem "rspec"
View labler.js
1 2 3 4 5 6 7 8 9 10
/* 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
1 2 3 4 5 6 7 8 9
[user]
name = Mislav Marohnić
email = mislav.marohnic@gmail.com
 
[color]
ui = true
 
[push]
default = simple
View fuzzy.coffee
1 2 3 4 5 6 7 8 9
# Get the shortest match (least distance between start and end index) for all
# the query characters in the given text.
#
# Returns an array in format [firstIndex, matchLength, [matchIndexes]]
shortestMatch = (text, queryChars) ->
starts = allIndexesOf(text, queryChars[0])
 
return if starts.length is 0
return [starts[0], 1, []] if queryChars.length is 1
View port-finder.rb
1 2 3 4 5 6 7 8 9 10
# ruby port-finder.rb | cut -f1 -d: | sort -n | uniq -c
#
# Verdict: it seems to be safe on Mac OS X, but it's *not safe* on Linux,
# where causal testing confirms that two subprocesses could pick the same port.
 
require 'socket'
 
module PortFinder
def self.call
server = TCPServer.new('127.0.0.1', 0)
View diff-gems.rb
1 2 3 4 5 6 7 8 9
#!/bin/bash
# Usage: diff-gems <branch>
#
# Shows diff between unpacked cached gems that changed on a branch.
set -e
 
branch="${1?}"
base_branch="origin/master"
merge_base="$(git merge-base "$base_branch" "$branch")"
View arch.md

Create the partition:

sgdisk --zap-all /dev/sda
cgdisk /dev/sda
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mnt

Edit the mirror list to bring the preferred mirror to the top:

Something went wrong with that request. Please try again.