My Recent Pastes (43 and counting)

All Pasties (over 43 and counting)

Pages: 1 3

Below are summaries of the 15 most recent pasties by Nic Williams.

December 05, 2007
11:53PM EDT
by Nic Williams

1
2
3
4
5
require 'rubygems'
require 'irb/completion'
require 'pp'
require 'what_methods'

November 08, 2007
12:24AM EDT
by Nic Williams

1
2
3
4
5
desc <<-EOS
Run Rubigen with G=\"<generator-name> <args>\" in the current directory.
S="merb rails" will make merb and rails generators available to be selected.
EOS
task :rubigen do

October 22, 2007
8:02PM EDT
by Nic Williams

1
2
3
4
5
%w[hpricot map_by_method to_activerecord openid].each do |gem_name|
  require gem_name
end

unless defined?(RedCloth)

October 06, 2007
10:32PM EDT
by Nic Williams

1
2
3
4
5
# p80 of cache_fu RailsConf07 slides
user_ids = @topic.posts.map(&:user_id).uniq
@users   = User.get_caches(user_ids) # I prefer this as it guarantees an Array

October 02, 2007
10:03PM EDT
by Nic Williams

1
2
3
<% cache "map/#{@node.id}/resource_list", :expire => 1.hour do %>
  <%= render :partial => "resources/resources", :locals => { :resources => @resources, :url => journey_map_path(@journey, @node) } %>
<% end -%>

September 11, 2007
8:22AM EDT
by Nic Williams

1
2
3
4
5
require 'rubygems'
require 'active_support'
require 'hpricot'
require 'open-uri'

September 11, 2007
3:16AM EDT
by Nic Williams

1
2
3
4
5
nicmac:/Applications/MAMP/Library nicwilliams$ ll
total 0
drwxrwxr-x    13 nicwilli  admin   442 May 15 12:07 .
drwxrwxr-x    20 nicwilli  admin   680 May 15 16:59 ..
drwxrwxr-x    89 nicwilli  admin  3026 May 15 12:08 bin

September 11, 2007
3:15AM EDT
by Nic Williams

1
nicmac:/Applications/MAMP/Library nicwilliams$

September 11, 2007
3:12AM EDT
by Nic Williams

1
2
3
4
5
$ sudo gem install mysql -- --with-mysql-dir=/Applications/MAMP/Library/ --with-mysql-lib=/Applications/MAMP/Library/lib
Bulk updating Gem source index for: http://gems.rubyforge.org
Select which gem to install for your platform (i686-darwin8.9.1)
 1. mysql 2.7.3 (mswin32)
 2. mysql 2.7.1 (mswin32)

September 11, 2007
3:11AM EDT
by Nic Williams

1
2
3
4
5
$ sudo gem install mysql -- --with-mysql-dir=/Applications/MAMP/Library/ --with-mysql-lib=/Applications/MAMP/Library/lib
Bulk updating Gem source index for: http://gems.rubyforge.org
Select which gem to install for your platform (i686-darwin8.9.1)
 1. mysql 2.7.3 (mswin32)
 2. mysql 2.7.1 (mswin32)

September 10, 2007
7:24AM EDT
by Nic Williams

1
2
3
4
5
# My life testing code

If feel I'm playing catch up with TDD/BDD.

Perhaps you are currently on the same path I've been on. If I look back, I recollect the following phases if my life testing code:

September 10, 2007
3:22AM EDT
by Nic Williams

1
2
3
4
5
# Problem

You can mock something without regard for what methods it can actually
support. 

August 26, 2007
2:14PM EDT
by Nic Williams

1
2
3
4
5
module FunctionalTestMatrix
  def matrix(name, *setups)
    @@matrix, @@setups = name, setups
  end

July 22, 2007
3:32AM EDT
by Nic Williams

1
2
3
4
5
class CreateUserOpenids < ActiveRecord::Migration
  def self.up
    create_table :user_openids do |t|
      t.string      :openid_url,  :null => false
      t.integer     :user_id,     :null => false

July 14, 2007
1:59AM EDT
by Nic Williams

1
2
3
4
5
module JRuby
  class Commands
    class << self
      # Provide method aliases to scripts commonly found in ${jruby.home}/bin.
      if File.directory?(Config::CONFIG['bindir'])

Next page