Public Gists by ffmike

Gravatar
Mon Nov 02 18:35:50 -0800 2009
1
2
3
if "irb" == $0
  ActiveRecord::Base.logger = Logger.new(STDOUT)
end
Gravatar
Sat Oct 31 07:26:39 -0700 2009
1
2
3
def sr_encrypt(data, args={})
  key ||= args[:key]
  puts key
Gravatar
Fri Oct 02 17:20:29 -0700 2009
1
2
3
# Two ways to do this...pretty much equivalent on effort, so pick the one that reads
# more smoothly to you
 
Gravatar
Fri Oct 02 04:59:50 -0700 2009
1
2
3
[capistrano_admin@bantha current]$ script/console playpen SITE=projecthope
Loading playpen environment (Rails 2.0.2)
=> "/u/apps/ggg/playpen/releases/20090929185746/config/mail_servers.yml" not found! Using default SMTP settings (if any).
Gravatar
Wed Sep 30 14:50:17 -0700 2009
1
2
3
68-29-154-155 [ruby:1.8.7:p174] ~/scratch/t7/vendor/t10 [development*] $ gem open active
Open which gem?
 1. activerecord 2.3.4
Gravatar
Sat Sep 26 12:56:31 -0700 2009
1
2
3
  context "An unauthenticated and unauthorized user doing a GET" do
    
    # Since we are not authenticated and authorized, we should be redirected
Gravatar
Mon Sep 21 11:58:39 -0700 2009
1
2
3
class NewUserCanSignupTest < ActionController::IntegrationTest
  context 'a site visitor' do
    setup do
Gravatar
Tue Sep 15 03:31:25 -0700 2009
1
2
3
# sneakiness to hook into Authlogic's password call chain
def crypted_password=(password)
  self[:crypted_password] = password
gist: 186164 Use Test::Unit 2.0 if prese...
Gravatar
Sun Sep 13 04:43:51 -0700 2009
1
2
3
# Use this preinitializer to allow Rails projects to work after installing
# Test::Unit 2.0, without forcing everyone on the project to install it.
begin
Gravatar
Mon Sep 07 07:24:14 -0700 2009
1
2
3
                        <CL_PROPERTY>
                            <PROPERTYKEY>VP4DLITE_DISTRESSED_AUCTION_DATE1</PROPERTYKEY>
                            <PROPERTYVALUE>java.util.GregorianCalendar[time=1251874800000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="US/Pacific",offset=-28800000,dstSavings=3600000,useDaylight=true,transitions=185,lastRule=java.util.SimpleTimeZone[id=US/Pacific,offset=-28800000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2009,MONTH=8,WEEK_OF_YEAR=36,WEEK_OF_MONTH=1,DAY_OF_MONTH=2,DAY_OF_YEAR=245,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=-28800000,DST_OFFSET=3600000]</PROPERTYVALUE>
Gravatar
Wed Sep 02 09:37:39 -0700 2009
1
2
3
1. Install external hard drive. I used a LaCie d2 Quadra. Didn’t bother with their Setup Assistant (who the heck still writes software that requires Rosetta?), just erased it with Disk Utility and formatted it as one big journaled OS X volume.
2. Install SuperDuper (http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html). I’m sure Carbon Copy Cloner is just as good, I just happen to be a SuperDuper user.
2a. At this point you may wish to delete anything from applications, documents, or your own user account that you won't want on the rebuilt machine. Apple's Migration Assistant is lamentably missing fine-toothed options for what to transfer.
Gravatar
Mon Aug 31 14:41:58 -0700 2009
1
2
3
Phoenix ~/railswork/iacez [development*] $ sudo gem update prawn
Updating installed gems
Updating prawn
Gravatar
Sun Aug 23 17:03:39 -0700 2009
1
2
3
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
require 'shoulda'
Gravatar
Thu Aug 13 11:05:29 -0700 2009
1
2
3
<VirtualHost *:80>
   ServerName gallery.client-interim.com
   DocumentRoot /u/apps/gallery/current/public
Gravatar
Wed Aug 12 09:45:12 -0700 2009
1
2
3
function insert_fields(link, method, content) {
  var new_id = new Date().getTime();
  var regexp = new RegExp("new_" + method, "g")
Gravatar
Tue Aug 11 05:07:54 -0700 2009
1
2
3
.DEPRECATION WARNING: The URL you generated will use the first matching route in routes.rb rather than the "best" match. In Rails 3.0 /accountid will be generated instead of /users/2. (called from generate at /Users/mike/scratch/t53/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:419)
DEPRECATION WARNING: The URL you generated will use the first matching route in routes.rb rather than the "best" match. In Rails 3.0 /account?id=2 will be generated instead of /users/2. (called from generate at /Users/mike/scratch/t53/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:419)
.DEPRECATION WARNING: The URL you generated will use the first matching route in routes.rb rather than the "best" match. In Rails 3.0 /accountid will be generated instead of /users/2. (called from generate at /Users/mike/scratch/t53/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:419)
Gravatar
Sun Aug 09 04:46:19 -0700 2009
1
2
3
  1) Failure:
test_multipart_post_with_multiparameter_attribute_parameters(IntegrationProcessTest) [/Users/mike/opensource/rails/actionpack/test/controller/integration_test.rb:386]:
<200> expected but was
Gravatar
Thu Jul 23 13:32:43 -0700 2009
1
2
3
ENV["RAILS_ENV"] = "test" if ENV["RAILS_ENV"].nil? || ENV["RAILS_ENV"] == ''
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
Gravatar
Thu Jul 23 13:08:12 -0700 2009
1
2
3
require 'test_helper'
 
class NotifierTest < ActionMailer::TestCase
gist: 145676 MOVED TO http://github.com/...
Gravatar
Sun Jul 12 08:58:27 -0700 2009
1
2
3
# download, from_repo, and commit_state methods swiped from
# http://github.com/Sutto/rails-template/blob/07b044072f3fb0b40aea27b713ca61515250f5ec/rails_template.rb