Skip to content

Instantly share code, notes, and snippets.

View sob's full-sized avatar

Sean O'Brien sob

View GitHub Profile
@sob
sob / gist:6829
Created August 22, 2008 18:07 — forked from defunkt/gist:6443
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
@sob
sob / gist:39524
Created December 24, 2008 00:15
undefined
<%
begin
eth0ip = Resolv::DNS.new.getaddress("@facts['fqdn']")
rescue
raise "Resolv::ResolvError: DNS result has no information for #{@facts['fqdn']}"
end
%>
DEVICE=eth0
ONBOOT=yes
TYPE=ethernet
@sob
sob / lead.rb
Created January 27, 2009 15:07
class Lead < ActiveRecord::Base
include Splam
has_force :oid => '<insert oid>'
validates_presence_of :first_name, :last_name
state_machine :state, :initial => 'pending' do
event :submit do
transition :to => 'spam', :from => 'pending', :if => :splam?
@sob
sob / test1
Created January 29, 2009 16:48
# mv backup ~/
context "on PUT to Admin::Contacts#spam" do
setup do
login_as(:quentin)
@contact = Factory(:contact)
put :spam, :id => @contact.id
end
should_assign_to :contact
should_set_the_flash_to /success/i
should_redirect_to 'admin_contacts_path()'
- flash.each do |key, value|
%div{:id => "flash_#{key}", :class => "flash #{key}", :style => value.blank? ? "display: none;" : ""}= h(value)
<%= form_for(@user) do |f| %>
<%= f.label(:name) %>
<%= f.text_field(:name) %>
<%= f.submit %>
<% end -%>
rsync --ignore-existing --progress --recursive --perms --times \
--size-only --whole-file --exclude='.*' \
--dry-run /Users/sobrien/Music/iTunes/iTunes\ Music/ /Volumes/sob\ time\ capsule\ 001/Music/
xml.instruct!
xml.Response do
xml.Gather(:numDigits => 4, :action => verify_confirmation_path(:id => @confirmation.token)) do
xml.Say "Please enter your pin code."
end
end
#!/usr/bin/ruby
#
# This script installs to /usr/local only. To install elsewhere you can just
# untar http://github.com/mxcl/homebrew/tarball/master anywhere you like.
#
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
# versions of OS X. I cannot verify that for sure, and it was tested on