Skip to content

Instantly share code, notes, and snippets.

View jmontross's full-sized avatar

Joshua Montross jmontross

View GitHub Profile
#
require "test/unit"
class String
def fun_string!
## make it work
end
end
@jmontross
jmontross / thoughts-from-10gen-and-tommy
Created August 3, 2012 02:10
rambles from the trenches
Went to a 10gen conference. Cornered smart man named antoinne and got below info.
use profiler built in..
check out google groups...
how to optimize design?
What is the objective of mongo?
denormalizing is about prejoining data.
@jmontross
jmontross / javascriptModule
Created June 21, 2012 17:44
Javascript module pattern with a closure
var awesomeModule = (function () {
var privateVariable;
function privateFunction() {
//do something;
}
return { // <----- this starts the object being returned when this module function executes
init: function () {
@jmontross
jmontross / test.rb
Created November 30, 2011 19:18 — forked from heftig/test.rb
def printgrid(table)
strings = table.map do |row|
row.map { |cell| cell.to_s }
end
column_widths = []
strings.each do |row|
row.each_with_index do |cell,i|
column_widths[i] = [column_widths[i] || 1, cell.length + 2].max
end
@jmontross
jmontross / ec2_client.rb
Created October 14, 2011 19:31 — forked from jtimberman/ec2_client.rb
generate user_data.json with knife, launch instance with it and magic!
# Author:: Adam Jacob <adam@opscode.com>
# Author:: Joshua Timberman <joshua@opscode.com>
#
# Copyright 2009-2010, Opscode, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0