This Gist has moved to a full git repo:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Remove stuff from the page to make github pages pretty for printing */ | |
console.log("Github pretty print 0.1"); | |
function removeClassElems(name) { | |
console.log("looking for class:", name); | |
Array.from(document.getElementsByClassName(name)).forEach(function(e) { | |
console.log("Removing", e); | |
e.parentNode.removeChild(e); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
alias 📄 puts | |
class A🖥 | |
@@🐴 = { | |
😂: 'Hello, world!', | |
🙃: 'HALP', | |
🖥: 'computer.', | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
if [ $# -ne 3 ]; then | |
cat >&2 <<EOM | |
usage: $(basename "$0") YEAR MONTH {high|low|concat-only} | |
EOM | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Syncs Ruby binstubs for ruby-communal-gems. | |
# Run this everytime you install a new Ruby, or when you install a new gem | |
# with a bin/ command. (ie, when you typically do rbenv rehash) | |
# | |
# See: https://github.com/tpope/rbenv-communal-gems/issues/5 | |
# | |
set -eu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import imaplib | |
import os | |
import logging | |
import optparse | |
# LABEL = 'support' | |
# QUERY = 'before:2015-06-01 -label:to-delete' | |
# DEST = 'to-delete' | |
LABEL = 'to-delete' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'openssl' | |
require 'socket' | |
METHODS = OpenSSL::SSL::SSLContext::METHODS.select {|m| (m.to_s =~ /_(client|server)$/).nil?} | |
PORT = 443 | |
HOST = ARGV[0] || 'qa.stripe.com' | |
IN_BUFFER = [] | |
OUT_BUFFER = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description "autossh tunnel to HOST" | |
author "Andy Brody" | |
start on (local-filesystems and net-device-up IFACE=eth0) | |
stop on runlevel [016] | |
respawn | |
respawn limit unlimited | |
setuid tunnel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 1.0 | |
set -eu | |
HOSTS=/etc/hosts | |
usage() { | |
cat <<EOM | |
usage: $(basename "$0") OPTION... | |
Modify /etc/hosts by adding or removing comments from lines by IP address. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
false() { | |
echo 'this is false' | |
command false | |
} | |
echo 'starting' |