Skip to content

Instantly share code, notes, and snippets.

View jmontross's full-sized avatar

Joshua Montross jmontross

View GitHub Profile
var FizzBuzz = function(x)
{
function isInt(n) {
return n % 1 === 0;
}
function divThree(n) {
var nThree = n / 3;
return nThree;
}
function divFive(n) {
@jmontross
jmontross / launch_sublime_from_terminal.markdown
Created August 9, 2012 21:52 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal. slim is the new mate

I forked this from someon symlinking subl to sublime.

I want slim, because it's well, slimmer.

This assumes you installed sublime text 2. if not - do that here - http://www.sublimetext.com/2

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

The reason why sublime is not shipped default is that it is too long to type. the reason for subl being lame is that it's not a word. textmate is great because I type mate to get along editing whatever directory or file I want. slim is the new mate and gives me those good feelings the way it is typed with few finger movements and has meaning.

ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/slim

@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