Public Gists by trak3r

Gravatar
Tue Nov 17 06:09:07 -0800 2009
1
2
3
  def campaigns_for_client_app(client_app)
    @summaries.find_all do |summary|
      client_app.id == summary.clientAppID.to_i
Gravatar
Thu Nov 12 07:11:30 -0800 2009
1
2
3
class Array
  def indifferent_intersection(other)
    self.collect{|i| i.to_sym} & other.collect{|i| i.to_sym}
Gravatar
Tue Nov 10 09:11:33 -0800 2009
1
2
3
some_variable = begin
  if some_condition?
    some_value
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)