Skip to content

Instantly share code, notes, and snippets.

View jmontross's full-sized avatar

Joshua Montross jmontross

View GitHub Profile
@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 / 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;
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 / 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 / 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>
@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,''))) })