Skip to content

Instantly share code, notes, and snippets.

View workling-edits.rb
require 'rubygems'
require 'optparse'
require 'yaml'
options = {}
ARGV.options do |opts|
opts.on( "-c", "--configfile ENVIRONMENT", String,
"mongrel cluster config file." ) do |config_file|
options[:config_file] = config_file
leah / gist:216443
Created October 22, 2009 23:07 — forked from steida/gist:216120
View gist:216443
¦-) as opposed to |
⍥ om nom nom
petros / CampfireIcons.txt
Created January 25, 2011 23:36
Campfire icons
View CampfireIcons.txt
peterc / deploy.rake
Created February 12, 2011 03:39
I can't be bothered with all of these fancy deployment systems. This works for me! Lazzzzy...
View deploy.rake
desc "Deploy site"
task :deploy do
sh %{git push origin master}
sh %{ssh server "cd /var/www/;git pull;bundle check || bundle;rake db:migrate;touch tmp/restart.txt;chown -R app:app *"}
rtomayko / latency.txt
Created June 1, 2012 00:43 — forked from jhclark/latency.txt
Latency numbers every programmer should know
View latency.txt
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 1 MB sequentially from memory 250,000 ns 0.25 ms
Round trip within same datacenter 500,000 ns 0.5 ms
Read 1 MB sequentially from SSD 1,000,000 ns 1 ms 4X memory
rubiojr / mr_status_bar_app.rb
Created November 30, 2009 11:47
MacRuby StatusBar Application
View mr_status_bar_app.rb
# Initialize the stuff
# We build the status bar item menu
def setupMenu
menu =
menu.initWithTitle 'FooApp'
mi =
mi.title = 'Hellow from MacRuby!'
mi.action = 'sayHello:'
View gist:885658
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5
Latest version of this file (in English) is usually at:
This file will also available in other languages:
Chinese -
davidcelis /
Created December 18, 2012 00:28
Output a Zelda-style heart meter for your MacBook's battery level. On the command line. Based on an idea from @stephencelis, executed by myself. For a tmux version, see
#!/usr/bin/env zsh
# Works best with blinking text; the last heart will blink
# when you have less than 25% of your battery life remaining.
BATTERY="$(pmset -g ps | awk 'NR==2' | perl -pe 's/.*?(\d+)%.*/\1/')"
if [[ $BATTERY -lt 25 ]]; then
echo "\e[5;31m♥\e[0;31m♡♡\e[0m"
elif [[ $BATTERY -lt 50 ]]; then
defunkt / gitio
Created September 11, 2011 08:11
Turn a URL into a URL.
View gitio
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
# Turns a URL
# into a URL
# Copies the URL to your clipboard.
url = ARGV[0]
code = ARGV[1]