Skip to content

Instantly share code, notes, and snippets.

View jmontross's full-sized avatar

Joshua Montross jmontross

View GitHub Profile
@jmontross
jmontross / gist:5647271
Created May 24, 2013 23:46
how to get more than 1000 s3 assets using fog gem in ruby
storage = Fog::Storage.new({:provider => 'AWS', :aws_access_key_id => ACCESS_KEY_ID, :aws_secret_access_key => SECRET_ACCESS_KEY})
files = storage.get_bucket("lessonOverFlow",{'max-keys' =>'100000'})
truncated = files.body['IsTruncated']
the_response = files.body['Contents']
while truncated
files = storage.get_bucket("lessonOverFlow",{'max-keys' =>'100000', 'marker' => files.body['Contents'].last["Key"]})
truncated = files.body['IsTruncated']
the_response = the_response + files.body['Contents']
end
@jmontross
jmontross / gist:5717616
Created June 5, 2013 21:52
american express add up the payments from transaction detail view page.
var amountSpent = 0;
$('.colAmmount').each(function($this,foo) { amountSpent += parseInt(foo.innerHTML.replace(/ /g,'').replace(/\n/g,'')) })
console.log(amountSpent);
$('.colAmmount').each(function($this,foo){ console.log($this,parseInt(foo.innerHTML.replace(/ /g,'').replace(/\n/g,''))) })
@jmontross
jmontross / index.html
Created May 28, 2013 16:22
A CodePen by Joshua Montross.
<div class="bigcircle">
<div class="circle circle1"> 1 </div>
<div class="circle circle2"> 2 </div>
<div class="circle circle3"> 3 </div>
<div class="circle circle4">4 </div>
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 / javascript closure example
Created March 19, 2013 23:58
javascript closure example
var addMultipleGameKeysModule = (function () {
var iGameKey;
function getGameKeys() {
var gameKeyList = [];
$j("input'[name*='GAMEKEY']").each(function(i){
gameKeyList.push($j(this).val());
});
return gameKeyList;
@jmontross
jmontross / gist:5068637
Created March 1, 2013 23:00
node_arduino
// var arduino = require("johnny-five")
// , board = new arduino.Board();
// /*, photo = require('./photo')
// , sendgrid = require)''
// */
// board.on("ready", function(){
// var button = new arduino.Button(7);
@jmontross
jmontross / set_up_my_machine.sh
Last active December 14, 2015 02:48
Run this file from ~/cookbooks/setup_my_machine.sh with bash after doing the following steps 1. installing command line tools for osx (download x-code from app store, open x-code, preferences -> downloads > command line tools) 2. mkdir ~/cookbooks; cd ~/cookbooks; git clone https://github.com/opscode-cookbooks/dmg; git clone git://github.com/jmo…
#!/bin/bash
# This shell script was created at solowizard.com
#
# Usage:
# Running the script remotely:
# bash < <(curl -s http://www.solowizard.com/soloist_scripts/frsp9k.sh )
# Running the script if you have downloaded it:
# ./frsp9k.sh
#
# http://github.com/tommyh/solo_wizard
@jmontross
jmontross / TODO-Pointmanj
Created August 23, 2012 03:27
pointmanj improvements
consider using xml format of standard resume.
@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 / Agile
Created August 6, 2012 23:05
Agile Thoughts
treat the business as an experiment - the business decisions are assumptions ...
discover how people learn and interact with a course - not how they should learn and interact.
conduct experiments to determine what techniques will work in their unique circumstances.