Skip to content

Instantly share code, notes, and snippets.

# Copyright (c) 2010, Philip Plante of EndlessPaths.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@burke
burke / ssh.rb
Created January 11, 2011 18:24
#!/usr/bin/env ruby
# Inspired by http://jeffmiller.github.com/2011/01/10/ssh-host-color
# == What this version does:
# 1) Launch an SSH process
# 2) Grab the IP that SSH connected to
# 3) Hash that IP and generate a colour from it
# 4) Change Terminal.app's background colour to that colour.
# 5) Change the colour back when SSH exits.
@wlach
wlach / get-gtfs-date-range.py
Created May 9, 2011 05:49
Simple and stupid python script to get the range of dates covered by its service periods (useful for telling if a feed is way out of date, or will be soon)
#!/usr/bin/python
import os
import sys
from codecs import iterdecode
from zipfile import ZipFile
import csv
import datetime
if len(sys.argv) < 2:
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@mccutchen
mccutchen / HOST-remote_app
Created January 17, 2012 20:06
Hacky remote TextMate setup for bitly VMs
#!/bin/sh
app=$1
shift;
open -a $app $@
@bsparrow435
bsparrow435 / gist:3486140
Created August 27, 2012 06:15
Delete keys map reduce

#Map Reduce Delete Instructions

Set allow_strfun true on all nodes:

echo "rpc:multicall([node() | nodes()], application,set_env,[riak_kv,allow_strfun,true])." | bin/riak attach

Insert 15000 keys:

for i in {1..15000}; do curl -XPUT http://127.0.0.1:9000/buckets/test/keys/test$i -H "content-type: text/plain" -d "Data #$i\n"; done
@mccutchen
mccutchen / HOST remote_app
Created November 15, 2012 19:33
Hacky remote editor setup for bitly VMs
#!/bin/sh
app=$1
shift;
open -a $app $@
@mbostock
mbostock / .block
Last active February 9, 2016 02:13 — forked from dchud/README.md
Streams
license: gpl-3.0
@tmcw
tmcw / index.html
Created December 14, 2012 05:55
Unknown Pleasures
<!DOCTYPE html>
<meta charset="utf-8">
<title></title>
<style>
body {
background:#000;
font: 10px sans-serif;
width:960px;
margin:0 auto;
@rasschaert
rasschaert / nsq-0.2.24.linux-amd64.go1.2.tar.gz-to-rpm.bash
Last active January 3, 2016 12:39
Creates an RPM package for NSQ (distributed messaging platform written in Golang). Tested on CentOS 6 x86_64 with EPEL and Golang 1.2.
#!/bin/bash
echo 'Downloading pre-built binaries'
wget https://s3.amazonaws.com/bitly-downloads/nsq/nsq-0.2.24.linux-amd64.go1.2.tar.gz
echo 'Extracting archive'
tar xzf nsq-0.2.24.linux-amd64.go1.2.tar.gz
echo 'Creating correct directory structure'
mkdir -p nsq-0.2.24.linux-amd64.go1.2/usr/local/
mv nsq-0.2.24.linux-amd64.go1.2/{bin,share} nsq-0.2.24.linux-amd64.go1.2/usr/local/