Skip to content

Instantly share code, notes, and snippets.

@phlipper
phlipper / gist:1116014
Created July 30, 2011 21:21
it's not pretty, but it's mine
%w[autotest/fsevent autotest/timestamp redgreen/autotest autotest/growl test_notifier/runner/autotest].each do |lib|
begin
require lib
rescue LoadError => e
warn "Couldn't load #{lib}: #{e}"
end
end
TestNotifier.default_notifier = :growl if defined? TestNotifier
require "openssl"
require "net/smtp"
Net::SMTP.class_eval do
private
def do_start(helodomain, user, secret, authtype)
raise IOError, 'SMTP session already started' if @started
check_auth_args user, secret, authtype if user or secret
sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
%w(open-uri rubygems pp irb/completion irb/ext/save-history wirble).each do |lib|
begin
require lib
rescue LoadError => e
warn "Couldn't load #{lib}: #{e}"
end
end
ARGV.concat %w( --readline )
#!/bin/sh
# GC Tuning
export RUBY_HEAP_MIN_SLOTS=800000
export RUBY_HEAP_SLOTS_INCREMENT=300000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=79000000
export RUBY_HEAP_FREE_MIN=100000
export RUBY_FREE_MIN=$RUBY_HEAP_FREE_MIN
@phlipper
phlipper / gist:1143542
Created August 13, 2011 06:32
~/.rvm/hooks/after_use_gc
case "$rvm_ruby_string" in
*ree*|*ruby-1.9.2*)
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_FREE_MIN=500000
export RUBY_FREE_MIN=$RUBY_HEAP_FREE_MIN
;;
*)
@phlipper
phlipper / gist:1225423
Created September 18, 2011 19:11
gosu req
g++ libgl1-mesa-dev libpango1.0-dev libboost-dev
libsdl-ttf2.0-dev libsdl-mixer1.2 libsdl-mixer1.2-dev
libfreeimage3 libfreeimage-dev
@phlipper
phlipper / gist:1386991
Created November 22, 2011 21:14
My TextMate Bundles!
# Textmate essential bundles
cd ~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles
# CSS
git clone git://github.com/textmate/css.tmbundle.git CSS.tmbundle
# Coffeescript
git clone git://github.com/jashkenas/coffee-script-tmbundle.git CoffeeScript.tmbundle
@phlipper
phlipper / string-strip.coffee
Created December 1, 2011 06:16
strip whitespace from a string
String::strip = -> if String::trim? then @trim() else @replace /^\s+|\s+$/g, ""
@phlipper
phlipper / ssl-functions.sh
Created December 5, 2011 04:00
easily generate a self-signed ssl certificates
function ssl-csr() {
openssl genrsa -out $1.key 1024
openssl req -new -key $1.key -out $1.csr
}
function ssl-cert() {
ssl-csr $1
openssl x509 -req -days 365 -in $1.csr -signkey $1.key -out $1.crt
}
@phlipper
phlipper / facebook-like-count.html
Created December 14, 2011 00:03
a quick demo of how to use the twitter json info
<!DOCTYPE html>
<html>
<head>
<title>JS Test</title>
</head>
<body id="" onload="">
<div id="results"></div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>