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
Jurassic Park (1993) movie script | |
by David Koepp. | |
Based upon the novel by Michael Crichton and on adaption by Michael Crichton and Malia Scotch Marmo. | |
Final draft, December 11, 1992. | |
More info about this movie on IMDb.com | |
1 EXT JUNGLE NIGHT |
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
# so everyone uses something like this for request-level authentication in Sinatra | |
class TestApp < Sinatra::Application | |
get "/path" do | |
require_authentication! | |
... | |
end | |
end | |
# and complain about how sinatra doesn't support per-route before filters like um, "other frameworks" |
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
require "open-uri" | |
require "active_support/base64" | |
class Mixpanel | |
def initialize(token, clock=Time.now) | |
@auth_token = token | |
@clock = clock | |
end | |
def event(name, properties={}) |
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
module Numbers | |
def foo | |
2 | |
end | |
def bar | |
foo * 2 | |
end | |
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
module Pathfinder | |
class Feat | |
class List | |
class NoMatchingSlotsAvailable < StandardError; end | |
include Enumerable | |
def initialize | |
@feats = [] | |
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
require "ffaker" | |
class ActiveRecord::Base | |
def self.define_factory(name=:factory, &block) | |
scope name, lambda { |overrides={}| | |
attributes = instance_eval(&block).merge(overrides) | |
where(attributes) | |
} | |
end | |
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
module Foo | |
def find(*) | |
"Foo#find" | |
end | |
end | |
class Blah | |
class << self | |
include Foo | |
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
run "rm public/index.html" | |
file "Isolate", <<-END | |
gem "rails", "3.0.1" | |
gem "haml", "3.0.22" | |
gem "sqlite3-ruby", "1.3.1" | |
env :development do | |
gem "haml-rails", "0.2" | |
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
This is basically an approximate drawing of the map between my home (H) and our | |
new office (O). The real map is http://bit.ly/home-to-office ("B" in the map is | |
my house, "A" the office). | |
I was bored while walking home from the office, and started thinking if it's | |
shorter to take a left or a right as I leave my house. (This only holds for | |
walking, biking there I must go through route a and come through route b due to | |
one-way streets, but I will walk there most days, since it's around 800-900m.) | |
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
# :facepalm: | |
class User < ActiveRecord::Base | |
validate do |user| | |
if user.login.blank? | |
user.errors.add_to_base("User Name can't be blank") | |
else | |
user.errors.add_to_base("User Name is too short(Minimum is 3 characters)") if user.login.length<3 and user.login.length !=0 | |
user.errors.add_to_base("User Name is too long(Maximum is 3 characters)") if user.login.length>40 | |
user.errors.add_to_base("User Name has already been taken.") if User.find_by_login(user.login) |