Skip to content

Instantly share code, notes, and snippets.

View dennyabraham's full-sized avatar
💭
🚁🦖

Denny Abraham dennyabraham

💭
🚁🦖
View GitHub Profile
@dennyabraham
dennyabraham / mass_insert_mongo.js
Created October 5, 2011 00:29 — forked from jimeh/mass_insert_mongo.js
Simple MySQL vs. MongoDB Insert benchmark.
for (var i=0; i < 100000; i++) {
db.mass_insert.save({
"first_name": "James",
"middle_name": "Richard",
"last_name": "Windsgate",
"email": "[email protected]"
});
};
@dennyabraham
dennyabraham / privacy_filter.rb
Created December 12, 2011 04:13 — forked from steveklabnik/privacy_filter.rb
A spec for a filter
class PrivacyFilter
class << self
def filter(controller)
@controller = controller
first_article? or administrator? or user?
end
def first_article?
@controller.params[:id] == 1