This file contains hidden or 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
1.66 GHz Intel Core Duo | |
1GB DDR2 SDRAM | |
80GB hard drive | |
Intel GMA950 graphics processor w/ 64MB memory | |
SuperDrive | |
1 FireWire 400 port | |
4 USB 2.0 ports | |
Ethernet and Airport | |
Apple Remote | |
Clean Leopard install |
This file contains hidden or 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 EventsController < ApplicationController | |
def create | |
@event = Event.new(params[:event]) | |
if @event.save | |
flash[:notice] = 'Event was successfully created.' | |
redirect_to :action => :index | |
else | |
render :action => :new | |
end |
This file contains hidden or 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
# | |
# Quick hack to map an iOS app's Core Data managed SQLite database into ActiveRecord | |
# | |
class CoreDataBase < ActiveRecord::Base | |
self.abstract_class = true | |
set_primary_key "Z_PK" | |
# Map all ZXXX attributes to XXX |
This file contains hidden or 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
$ rvm ruby-1.9.2-p136@ingredients | |
$ gem list | |
animalcracker (0.0.2) | |
bacon (1.1.0) | |
beet (0.6.9) | |
berry (0.0.0) | |
breadcrumbs (0.1.5) | |
butternut (0.2.1) |
This file contains hidden or 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
<!-- layout file --> | |
<% if current_user %> | |
Welcome <%= current_user.username %>. Not you? <%= link_to "Log out", logout_path %> | |
<% else %> | |
<%= link_to "Sign up", signup_path %> or <%= link_to "log in", login_path %>. | |
<% end %> |
This file contains hidden or 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
# Toss this in your ~/.irbrc file for a convenient way | |
# to peruse Ruby source code in TextMate. This | |
# only works in Ruby 1.9! | |
# | |
# Use it in irb like so: | |
# | |
# >> require 'active_record' | |
# >> ActiveRecord::Base.source_for_method(:create) | |
class Object |
This file contains hidden or 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
# | |
# Run this inside TextMate using Cmd-R | |
# | |
# puts x | |
# | |
# Basically any error will trigger it. | |
/Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/catch_exception.rb:15:[BUG] Segmentation fault | |
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0] |
This file contains hidden or 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 Course < ActiveRecord::Base | |
def self.prototype(overrides={}) | |
attributes = { | |
:code => 'ruby', | |
:title => 'Ruby Programming', | |
:active => true, | |
:released_on => 15.days.ago | |
} | |
new(attributes.merge(overrides)) | |
end |
This file contains hidden or 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/env ruby | |
# API Documentation at http://api.wikia.com/wiki/LyricWiki_API | |
require 'open-uri' | |
require 'json' | |
require 'tmpdir' | |
ARTIST = "Johnny Cash" |
This file contains hidden or 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 ChangePerspective < ActiveRecord::Migration | |
def change | |
rename_table :users, :customers | |
end | |
end |
OlderNewer