This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mv backup ~/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- flash.each do |key, value| | |
%div{:id => "flash_#{key}", :class => "flash #{key}", :style => value.blank? ? "display: none;" : ""}= h(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for(@user) do |f| %> | |
<%= f.label(:name) %> | |
<%= f.text_field(:name) %> | |
<%= f.submit %> | |
<% end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
OlderNewer