Skip to content

Instantly share code, notes, and snippets.

<?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>
@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
@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 / upgrade_postgres_9.0-9.1.sh
Created November 29, 2011 03:29
Upgrade PostgreSQL from 9.0 to 9.1
#!/bin/sh
#
# Upgrade PostgreSQL from 9.0 to 9.1
#
# by David Sommers
#
brew update postgres
@databyte
databyte / ruby-debug19-install.sh
Created December 14, 2011 04:17
Install ruby-debug19 for ruby-1-9-3
wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
wget http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
gem install linecache19-0.5.13.gem
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rvm/src/ruby-1.9.3-p194
rm linecache19-0.5.13.gem
rm ruby-debug-base19-0.11.26.gem
@databyte
databyte / rake test
Created March 15, 2012 22:42
rabl test results with failed rails2 tests
hades ☯ ~/projects/rabl ‹1.9.3@rabl› ➤ b8434e0-master⚡
11085 ± $ rake test:fixtures ⏎ [8m] ✹ ✭ [18:40:27]
*** Running tests for padrino_test... ***
/Users/databyte/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -I"lib" -I"/Users/databyte/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib" "/Users/databyte/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb" "test/app/controllers/**/*_test.rb"
The Gemfile's dependencies are satisfied
....................................
36 passes, 0 failures, 0 errors in 0.551838 seconds
@databyte
databyte / carrierwave.rb
Created April 3, 2012 22:19
CarrierWave Uploader spec stubbing
CarrierWave::Uploader::Base.descendants.each do |klass|
next if klass.anonymous?
klass.class_eval do
def cache_dir
"#{Rails.root}/public/system/test/#{Process.pid.to_s}/tmp"
end
def store_dir
"#{Rails.root}/public/system/test/#{Process.pid.to_s}/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
@databyte
databyte / output.txt
Created April 26, 2012 18:19
Rabl: rake test:setup
*** Setting up for padrino_test tests ***
Using rake (0.9.2.2)
Using multi_json (1.3.2)
Using activesupport (3.1.4)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.4)
Using arel (2.2.3)
Using tzinfo (0.3.33)
Using activerecord (3.1.4)
@databyte
databyte / rsolr_test.rb
Created May 4, 2012 21:00
rsolr memory leak test
require 'rsolr'
require 'thread'
require 'optparse'
require 'ruby-debug'
require 'ruby-prof'
module Allocation
def self.count
GC.disable
before = ObjectSpace.count_objects
@databyte
databyte / results.txt
Created June 21, 2012 05:24
USB 2_0 benchmark results
Kingston DataTraveler 108
Results 2.94
System Info
Xbench Version 1.3
System Version 10.7.4 (11E53)
Physical RAM 8192 MB
Model MacBookPro8,2
Drive Type Kingston DataTraveler 108
Disk Test 2.94