Skip to content

Instantly share code, notes, and snippets.

View phiggins's full-sized avatar

pete higgins phiggins

View GitHub Profile
@phiggins
phiggins / broken_sexp_sort.rb
Created August 1, 2012 06:17
broken_sexp_sort.rb
require 'rubygems'
require 'sexp_processor'
#def uses_if
# if some_func
# if some_other_func
# return
# end
# end
#end
@phiggins
phiggins / bar_test.rb
Created February 4, 2012 23:09
MiniTest commandline
require 'minitest/autorun'
describe "bar" do
it "tests stuff" do
assert true
end
end
[14:18:47 tera-refinery (substantial-mvp u=)]$ for i in 1.9.2 1.9.3 1.9.3-perf ; do rvm use "$i"@tera-refinery && time rspec ; doneUsing /Users/pete/.rvm/gems/ruby-1.9.2-p290 with gemset tera-refinery
:public is no longer used to avoid overloading Module#public, use :public_folder instead
from /Users/pete/.rvm/gems/ruby-1.9.2-p290@tera-refinery/gems/resque-1.18.6/lib/resque/server.rb:12:in `<class:Server>'
...................................................................................
Finished in 11.24 seconds
83 examples, 0 failures
real 0m33.571s
user 0m26.964s
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC2N1G10hpUUPw0TRrn4TiLWVi9DIxWG1JfEjrhYo1aX8A4g9L6Ur+ttC+tIqKmTad+xeg3QnIG8V8u1ld/Q+z8kUXvBAfBCtTHKsFFPF6i+FbYyOznDjtvLmHS9+YzKZJXLqtwi5cN766bzaGHfxv0pF6iP3x1idiQo6h25muopWfsxapWGph7Gaanv/cXuCW+qc6LoIIOLwO0veyfpT3sdk9rQN3WqVdKuCJcght0x7ROpgNsuUkFPUNpu1fR4/Jjd1X3YKR0G6aHBlyP0vG9lsSBNkr0gZJTVfWiRFmzz2rwK+3Sg0jTybq5eh+xJ2l/dJXKkNFFuqwiBCmifUVX [email protected]
class Venue < ActiveRecord::Base
has_many :events
end
class Artist < ActiveRecord::Base
has_many :events
end
class Event < ActiveRecord::Base
belongs_to :venue
require 'spec_helper'
describe "default path" do
it "routes /blog/posts/1 to the Blog::Post controller" do
get('/blog/posts/1').
should route_to(
:controller => "refinery/blog/posts",
:action => "show",
:id => "1",
)
@phiggins
phiggins / gist:1492644
Created December 18, 2011 07:29
rubinius build output
$ ./configure && rake
Checking gcc: found
Checking bison: found
Configuring LLVM...
Checking for existing LLVM library tree: found!
Checking sizeof(short): 2 bytes
Checking sizeof(int): 4 bytes
Checking sizeof(void*): 8 bytes
Checking sizeof(size_t): 8 bytes
@phiggins
phiggins / minitest_sample.rb
Created October 3, 2011 03:41
Demo of using the gem version of minitest.
class User
def valid?
true
end
end
gem 'minitest'
require 'minitest/autorun'
describe User do
@phiggins
phiggins / benchmark_memcache_multi_get.rb
Created July 26, 2011 05:50
benchmark_memcache_multi_get.rb
require 'memcache'
require 'benchmark'
N = (ARGV.first || 1_000).to_i
puts "N == #{N}"
dstore = Memcache.new(:server => 'localhost:11211')
dstore.set('key1', 'value')
@phiggins
phiggins / profile_dalli_multi_get.rb
Created July 25, 2011 07:54
profile_dalli_multi_get.rb
require 'dalli'
require 'ruby-prof'
N = (ARGV.first || 1_000).to_i
puts "N == #{N}"
dstore = Dalli::Client.new('localhost:11211')
dstore.set('key1', 'value')