Public Gists by trak3r

Gravatar
Thu Jul 09 05:11:16 -0700 2009
1
2
3
ted@ceylon /usr/bin »ls -al | grep -i ruby
lrwxr-xr-x 1 root wheel 75 May 21 05:31 erb -> ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/erb
lrwxr-xr-x 1 root wheel 71 May 21 05:31 gem -> ../../System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem
gist: 143349 where ruby hides on os x
Gravatar
Wed Jul 08 18:24:26 -0700 2009
1
lrwxr-xr-x 1 root wheel 76 May 21 05:31 /usr/bin/ruby -> ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
gist: 140552 all my gems
Gravatar
Sat Jul 04 05:17:23 -0700 2009
1
sudo gem install ZenTest actionmailer actionpack activerecord activeresource activesupport autotest-fsevent autotest-rails beanstalk-client capistrano capistrano-ext columnize ctran-annotate curb engineyard-eycap fastercsv fastthread highline hoe httpclient libxml-ruby linecache mysql net-scp net-sftp net-ssh net-ssh-gateway nokogiri passenger plist rack rails rake redgreen rspec rspec-rails ruby-debug ruby-debug-base rubyforge rubyist-aasm sevenwire-forgery soap4r sys-uname taf2-curb taf2-rmem thoughtbot-factory_girl
gist: 134143 assert_close_enough
Gravatar
Mon Jun 22 12:29:40 -0700 2009
1
2
3
  def assert_close_enough(target, actual, message = nil)
    lower = (0.9 * target.to_f).floor
    upper = (1.1 * target.to_f).ceil
Gravatar
Thu Jun 04 13:46:19 -0700 2009
1
2
3
  def self.included(receiver)
    receiver.class_eval <<-RUBY
    named_scope :latest_before, lambda {|time| {:conditions => ['created_at < ?', time]}}
Gravatar
Sun May 24 07:16:27 -0700 2009
1
2
3
# from: http://pivotallabs.com/users/alex/blog/articles/865-monkey-patch-du-jour
module ActiveRecord
  module ConnectionAdapters
Gravatar
Thu Jan 08 13:41:19 -0800 2009
1
2
3
def has_role?(role)    
# if list isn't already assigned to something, create an array of the names of my roles
list ||= self.roles.map(&:name)    
Gravatar
Wed Jan 07 13:00:47 -0800 2009
1
2
3
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
Gravatar
Tue Jan 06 14:44:22 -0800 2009
1
2
3
= link_to_remote(image_tag(video.thumbnail_url, :alt => h(video.title)), :update => 'main', :url => { :action => 'wtf', :id => video.id })
 
# produces "/videos/wtf/77"
Gravatar
Fri Dec 26 09:08:12 -0800 2008
1
2
3
$ port list | grep ruby
ruby @1.8.7-p72 lang/ruby
 
Gravatar
Fri Dec 19 04:30:47 -0800 2008
1
2
3
Dear Git experts,
 
The other day I had made a change to my code and committed it then realized I was in an unrelated branch; I had intended to commit the change to master.