Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Sat Apr 24 20:33:56 PDT 2010
# This file was generated by rpg-config on behalf of rtomayko
# Remove comment characters and edit values to change the default config
# rvm environments share index, packs, and gem cache directories.
test $(id -un) != root && {
RPGINDEX=~/.rpg/index
RPGPACKS=~/.rpg/packs
@rtomayko
rtomayko / gist:814024
Created February 7, 2011 05:11
sample of github git fetch times by protocol
$ uname -a && git --version
Darwin asha.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386
git version 1.7.2.1
$ git clone git://github.com/github/gitignore.git
$ cd gitignore
$ # fetching over ssh
$ yes | head -5 | (while read ; do time git fetch git@github.com:github/gitignore.git; done) 2>&1 | grep real
real 0m2.103s
This time bay-beee i'll beeeeeeEEEEEEEEEeeeee - BullehhhhhhhhhhhhhhhT PROOOF.
@rtomayko
rtomayko / jquery-hotload.js
Created August 6, 2010 06:07
hotload jquery
// paste this into firebug or chrome console or whatever
// to load jquery into pages that dun have it
j=document.createElement("SCRIPT");
j.src="http://code.jquery.com/jquery-latest.pack.js";
document.getElementsByTagName("HEAD")[0].appendChild(j);
@rtomayko
rtomayko / bacon
Created May 17, 2010 23:31
bacon(1)
#!/bin/sh
# Usage: bacon <file>
# Upload <file> to baconfile.com and copy URL to pasteboard.
#
# You baconfile.com credentials must exist in ~/.netrc, like this:
#
# machine baconfile.com
# login garfield
# password ironman04
#
@rtomayko
rtomayko / unicorn_github
Created May 17, 2010 19:56
GitHub RailsBench GC settings
#!/bin/sh
# Usage: unicorn_github
# Script used to start unicorn in GitHub staging and production environments.
# This is called primarily by god.
set -e
# configure GC settings
export RUBY_HEAP_MIN_SLOTS=800000
export RUBY_HEAP_FREE_MIN=100000
export RUBY_HEAP_SLOTS_INCREMENT=300000
_________________________________________
/ you really should just stay up and keep \
\ drinking it /
-----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
#!/usr/bin/env ruby
## Usage: memrate.rb [-l <lib>] [-i <num>] [-t <threshold>] [-k <size>] [<host>]
## Measure memcached server read time.
##
## Options
## -l, --library=<lib> Memcached client library to use. memcache-client by
## default. memcached also supported.
## -i, --iterations=<num> Number of times to read the value. If not set, read
## until interrupted.
## -t, --threshold=<time> Report iterations that take longer than <time>
# GC on Template finalize
class Template
module CompiledTemplates; end
def self.garbage_collect_compiled_method(object_id)
CompiledTemplates.module_eval do
remove_method Template.compiled_method(object_id)
end
end
require 'etc'
require 'campfire'
namespace :notify do
desc 'Alert Campfire of a deploy'
task :campfire do
branch_name = branch.split('/', 2).last
deployer = Etc.getlogin
deployed = `curl -s http://github.com/site/sha`[0,7]
deploying = `git rev-parse HEAD`[0,7]