Public Gists by timriley

Gravatar
Sun Oct 11 04:57:26 -0700 2009
1
2
3
require 'pp'
 
class Object
Gravatar
Sat Aug 29 00:41:45 -0700 2009
1
2
3
sudo port install ruby
sudo port install rb-rubygems
 
Gravatar
Fri Aug 21 17:44:21 -0700 2009
1
2
3
require 'open-uri'
require 'hpricot'
 
Gravatar
Mon Aug 10 20:27:33 -0700 2009
1
2
3
In response to all the responses to:
 
http://twitter.com/rtomayko/status/1155906157
Gravatar
Tue Jul 28 17:10:21 -0700 2009
1
2
3
#!/usr/bin/env ruby
#
# A hook script to verify that only syntactically valid ruby code is commited.
Gravatar
Tue Jun 30 19:39:07 -0700 2009
1
2
3
require 'irb/completion'
require 'irb/ext/save-history'
require 'rubygems'
Gravatar
Thu Jun 25 20:47:52 -0700 2009
1
alias dewip="sed -E -i '' -e '/^[[:blank:]]*@wip$/d;s/,[[:blank:]]*@wip//g;s/@wip,[[:blank:]]*//g' features/**/*.feature"
Gravatar
Thu Jun 18 23:51:14 -0700 2009
1
2
3
# Bash snippet to open new shells in most recently visited dir.
# Useful if you want to open a new terminal tab at the present
# tab's location.
Gravatar
Mon Jun 15 19:40:46 -0700 2009
1
2
3
# Three things to add:
# * before_filter call
# * action_has_layout? method (if you have one, combine them)
Gravatar
Tue Jun 02 19:02:06 -0700 2009
1
2
3
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
Gravatar
Mon May 11 10:17:01 -0700 2009
1
2
3
# Example of simplifying Cucumber stories by assuming you can read simple Ruby structures
#
# Used in my presentation:
Gravatar
Mon May 11 10:16:55 -0700 2009
1
2
3
# Chuck this in config/initializers for view-first validations
ActionView::Base.default_form_builder.class_eval do
  def error(field)
Gravatar
Wed May 06 20:16:07 -0700 2009
1
2
3
# first you'll want to create a gist then `git clone` the private url
# second you'll want to run this script in the gist's directory
loop do
Gravatar
Mon Apr 20 20:51:40 -0700 2009
1
2
3
# 1. Create dirs for unpacking your source code and installing your apps
mkdir $HOME/src
mkdir $HOME/apps
Gravatar
Wed Mar 25 03:02:08 -0700 2009
1
2
3
#!/usr/bin/env ruby
 
################
Gravatar
Thu Mar 05 20:45:28 -0800 2009
1
2
3
# printf "\033[0m0 All attributes off\033[0m\n"
# printf "\033[1m1 Bold\033[0m\n"
# printf "\033[4m4 Underline\033[0m\n"
Gravatar
Thu Mar 05 20:33:06 -0800 2009
1
2
3
function sc {
  if [ -x script/console ]; then
script/console
Gravatar
Tue Mar 03 15:00:08 -0800 2009
1
2
3
When /^I go to (.+)$/ do |page_name|
  visit path_to(page_name)
end
Gravatar
Tue Mar 03 14:56:28 -0800 2009
1
2
3
Feature: Users cannot access to the system without logging in
  In order to protect the system from unauthorized access
  An anonymous user
Gravatar
Tue Mar 03 14:55:37 -0800 2009
1
2
3
Then /^I should be on the (.+?) page$/ do |page_name|
  request.request_uri.should == send("#{page_name.downcase.gsub(' ','_')}_path")
  response.should be_success