Public Gists by trak3r

Gravatar
Fri Nov 06 12:25:05 -0800 2009
1
2
3
RAILS_GEM_VERSION = nil
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '../../..'))
RAILS_ENV = ENV['RAILS_ENV'] || 'development'
Gravatar
Fri Nov 06 09:33:03 -0800 2009
1
2
3
ted@ceylon ~/Sites/asm/config/cloud-crowd »gem list | grep -i rails
autotest-rails (4.1.0)
rails (2.3.4, 2.3.2, 2.2.2, 1.2.6)
Gravatar
Fri Nov 06 08:47:41 -0800 2009
1
2
3
ted@ceylon ~/Sites/asm/config/cloud-crowd »crowd load_schema
-- create_table("jobs", {:force=>true})
   -> 0.1031s
Gravatar
Mon Nov 02 07:34:40 -0800 2009
1
2
3
def remote_file_exists?(full_path)
  'true' == capture("if [ -e #{full_path} ]; then echo 'true'; fi").strip
end
Gravatar
Fri Oct 30 10:21:12 -0700 2009
1
2
3
  def last_wednesday
    today = Date.today
    backup = ((4 + today.wday) % 7)
Gravatar
Thu Oct 29 09:35:53 -0700 2009
1
2
3
module Enumerable
  def most?(&block)
    trues = 0
Gravatar
Thu Oct 15 07:26:54 -0700 2009
1
2
3
What's documented:
 
  StreetAddress.find(1, :params => { :person_id => 1 })
Gravatar
Tue Oct 13 19:05:25 -0700 2009
1
2
3
            doppleganger = Class.new(ActiveRecord::Base)
            doppleganger.set_table_name "latest_#{self.class.table_name}"
            Object.const_set "Latest#{self.class.name}", doppleganger
Gravatar
Sat Oct 10 08:04:17 -0700 2009
1
2
3
ted@teds-laptop:~$ ruby -v
The program 'ruby' is currently not installed. You can install it by typing:
sudo apt-get install ruby
Gravatar
Sun Oct 04 09:18:18 -0700 2009
1
2
3
tell application "Terminal"
activate
do script with command "cd ~/my/development/directory"
Gravatar
Sat Aug 29 17:28:10 -0700 2009
1
2
3
      === Epic Snow Leopard Upgrayyyyd Guide ===
 
Son, you’re now living in the land of 64-bit systems.
Gravatar
Thu Aug 27 11:07:54 -0700 2009
1
2
3
# dump table with data
# to be called by migration prior to potentially-dangerous operation
class ActiveRecord::Migration
Gravatar
Thu Jul 30 08:29:57 -0700 2009
1
2
3
http://forums.atlassian.com/thread.jspa?messageID=257299176&tstart=0
 
1. Change the Base SDK in the Xcode Project to "Simulator - iPhone OS 2.2"
gist: 154271 big honking sql join
Gravatar
Fri Jul 24 07:13:19 -0700 2009
1
2
3
# Note: Schema is legacy (not my design!)
class WidgetSummary < ActiveRecord::Base
  class << self
gist: 147115 remove minutes/seconds from...
Gravatar
Tue Jul 14 12:08:46 -0700 2009
1
2
3
class Time
  def no_minutes
    return self - self.min.minutes - self.sec.seconds
gist: 144114 thread bug in capistrano
Gravatar
Thu Jul 09 17:05:51 -0700 2009
1
2
3
        # threads = Array(servers).map { |server| establish_connection_to(server, failed_servers) }
        # threads.each { |t| t.join }
        Array(servers).each { |server| safely_establish_connection_to(server, Thread.current, failed_servers) }
gist: 143618 all my gems with versions
Gravatar
Thu Jul 09 05:34:43 -0700 2009
1
2
3
*** LOCAL GEMS ***
 
actionmailer (2.3.2, 1.3.6)
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