Skip to content

Instantly share code, notes, and snippets.

View eltiare's full-sized avatar

Jeremy Nicoll eltiare

View GitHub Profile
@eltiare
eltiare / gist:105103
Created May 1, 2009 15:44
binary42 bio.txt
Brian Mitchell currently resides in Manhatten, though he likes to travel. He does consulting with the programming language Ruby, and he's also a ninja. Not the Rockstar-drinking-stay-up-all-night-coding type of ninja, but a slash-you-through-with-a-katana-whilst-you're-not-looking type of ninja. Brian is a recent refugee from Somalia, his family immigrating there 30 years ago but decided to move back to the states due to unpleasant conditions existing in Somalia. Brian enjoys reading books in other languages. His favorite language to read is Klingon. On the days he is feeling adventurous, he'll seek out books written _backwards_ in Klingon. Brian also likes to compose music by writing programming scripts that call random phone numbers at random intervals, record their voices, and then cut and splice the recordings into neoclassical works. He has found this quite effective as people's tones vary wildly depending on the time of day in which the phone call is made. Brian has graduated from five different unive
class SuperParent
include DataMapper::Resource
property :id, Serial
has n, :parents
end
class Parent
include DataMapper::Resource
property :id, Serial
/srv/www/photo-op/gems/gems/merb_datamapper-1.0.12/lib/merb_datamapper.rb:61:in `run': undefined method `merge' for #<DataMapper::Model::DescendantSet:0x2534538> (NoMethodError)
from /srv/www/photo-op/gems/gems/dm-core-0.10.1/lib/dm-core/model/descendant_set.rb:33:in `each'
from /srv/www/photo-op/gems/gems/dm-core-0.10.1/lib/dm-core/model/descendant_set.rb:33:in `each'
from /srv/www/photo-op/gems/gems/merb_datamapper-1.0.12/lib/merb_datamapper.rb:60:in `run'
from /srv/www/photo-op/gems/gems/merb-core-1.0.12/lib/merb-core/bootloader.rb:99:in `run'
from /srv/www/photo-op/gems/gems/merb-core-1.0.12/lib/merb-core/server.rb:172:in `bootup'
from /srv/www/photo-op/gems/gems/merb-core-1.0.12/lib/merb-core/server.rb:42:in `start'
from /srv/www/photo-op/gems/gems/merb-core-1.0.12/lib/merb-core.rb:170:in `start'
from /srv/www/photo-op/gems/gems/merb-core-1.0.12/bin/merb:11
from /opt/ruby-enterprise/bin/merb:19:in `load'
class User
include DataMapper::Resource
property :id, Serial
property :priority, Integer
end
class Posting
property :id, Serial
<html>
<head>
<title>Testing</title>
</head>
<body>
<form action="./" method="post">
<input type="text" name="question[id]"/>
<input type="text" name="question[text]" />
<input type="text" name="question[user][email]" />
</form>
class MiniRouter
class << self
def routes; @routes ||= [] end
def named_routes; @named_routes ||= {} end
def context; @context ||= Context.new(self) end
def add_routes(&blk)
raise 'add_routes requires a block' unless block_given?
context.instance_eval(&blk)
end
<ul class="jqueryFileTree" style="display: none;">
<% @dirs.each do |dir| %>
<li class="directory collapsed"><a href="#" rel="<%= params[:dir] / dir %>"><%= dir %></a></li>
<% end %>
<% @files.each do |file| %>
<li class="file ext_<%= File.extname(file)[1..-1] %>"><a href="#" rel="<%= params[:dir] / file %>"><%= file %></a></li>
<% end %>
</ul>
# Routes
match '/javascripts/ckeditor/plugins/filemanager/connectors/rb/filemanager.rb', :to => 'filemanager#show'
match '/javascripts/ckeditor/plugins/filemanager/scripts/jquery.filetree/connectors/jqueryFileTree.rb', :to => 'filemanager#filetree'
# Duck punching
class Pathname
def /(other); File.join(self, other) end
end
class String
var application = {
page_loaded : false,
page_init : function() {
var i;
application.page_loaded = true;
// Load scripts that have not already been loaded.
var script;
for (i=0; script = application.scripts_to_load[i]; i++) {
ree-1.8.7-2010.02 > post = Post.all[3]
typewhat_production['posts'].find({}, {})
=> #<Post _id: 4d2f69c90190bd17a7000001, created_at: Thu Jan 13 21:08:25 UTC 2011, image_filename: "captcha-hindi.png", title: "Zepplin 4?", updated_at: Thu Jan 13 21:15:27 UTC 2011, user_url: nil, approved: false, user_id: nil, user_name: "", approved_at: nil, user_email: "", : "">
ree-1.8.7-2010.02 > post.approve!
=> Thu, 13 Jan 2011 21:17:50 +0000
ree-1.8.7-2010.02 > post.save
MONGODB typewhat_production['posts'].update({"_id"=>BSON::ObjectId('4d2f69c90190bd17a7000001')}, {"$set"=>{"updated_at"=>Thu Jan 13 21:17:52 UTC 2011, "approved"=>true, "approved_at"=>Thu Jan 13 21:17:50 UTC 2011}})
=> true
ree-1.8.7-2010.02 > post.reload
typewhat_production['posts'].find({:_id=>BSON::ObjectId('4d2f69c90190bd17a7000001')}, {}).limit(-1)