Skip to content

Instantly share code, notes, and snippets.

View jacqui's full-sized avatar

Jacqui Lough jacqui

View GitHub Profile
@jacqui
jacqui / gist:983051
Created May 20, 2011 14:43 — forked from pauldix/gist:981916
Redis SORT command examples
# Optimized for writes, sort on read
# LVC
redis.hset("bonds|1", "bid_price", 96.01)
redis.hset("bonds|1", "ask_price", 97.53)
redis.hset("bonds|2", "bid_price", 95.50)
redis.hset("bonds|2", "ask_price", 98.25)
redis.sadd("bond_ids", 1)
redis.sadd("bond_ids", 2)
require 'rubygems'
fetcher = Gem::SpecFetcher.fetcher
my_dep = 'activesupport'
# 1st arg = all (true to get all versions, false to get latest)
# 2nd arg = prerelase (true to get pre-release gems, false to get stable)
all_gems = fetcher.list(false, false)
@mikhailov
mikhailov / ruby_gc.sh
Created March 11, 2011 10:33
Ruby’s GC Configuration
- http://www.coffeepowered.net/2009/06/13/fine-tuning-your-garbage-collector/
- http://snaprails.tumblr.com/post/241746095/rubys-gc-configuration
article’s settings: ("spec spec" took 17-23!sec)
export RUBY_HEAP_MIN_SLOTS=1250000
export RUBY_HEAP_SLOTS_INCREMENT=100000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=30000000
export RUBY_HEAP_FREE_MIN=12500
@bryanl
bryanl / campfire-emoji.txt
Created January 27, 2011 16:34
campfire emoji
Surround these with : e.g. :calling:
+1
-1
bulb
calling
clap
cop
email
feet
if Rails.env.development?
around_filter :perform_profile
end
# In development mode, optionally perform a RubyProf profile of any request.
# Simply pass perform_profile=true in your params.
def perform_profile
return yield unless params[:perform_profile]
require 'ruby-prof'
RubyProf.start
@mbbx6spp
mbbx6spp / .vimrc
Created August 31, 2010 20:57
Start configuration for vim for new shell accounts. this starter config depends on the following Vim plugins: rails, pathogen, vimchat, sessionman, bufexplorer, fuzzy finder, NERDTree, gist. Primary development languages: Erlang, Haskell, Ruby, Zsh scrip
" Author: Susan Potter
" Using ~/.vim/supo as placeholder initialization VimScripts location.
" Didn't want to use ~/.vim/init in case init had or starts to have special meaning for Vim plugins or loading.
source $HOME/.vim/supo/global.vim
source $HOME/.vim/supo/functions.vim