Skip to content

Instantly share code, notes, and snippets.

@databyte
databyte / gc_spec.rb
Created October 24, 2011 06:35
Speed up GC for specs
$gc_counter = 0
GC.disable
config.after(:each) {
if($gc_counter.modulo(25) == 0)
GC.enable
GC.start
GC.disable
end
$gc_counter += 1
@databyte
databyte / auth_logic_crypt
Created October 24, 2011 06:01
Speed up AuthLogic for specs
module SpecCryptoProvider
def self.encrypt(*tokens)
tokens.join("")
end
def self.matches?(crypted, *tokens)
encrypt(*tokens) == crypted
end
end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.redis.redis-server</string>
<key>Program</key>
<string>/usr/local/bin/redis-server</string>
<key>ProgramArguments</key>