Skip to content

Instantly share code, notes, and snippets.

@johnschimmel
johnschimmel / gist:1941724
Created February 29, 2012 15:36
Developing locally and deploying NodeJS on Heroku

Initial NodeJS setup

with heroku toolbelt installed run following in code directory (via Terminal)

npm install
git init
git add .
git commit -am "initial commit"
foreman start
@johnschimmel
johnschimmel / gist:2079811
Created March 18, 2012 18:58
displayAll.html
<!doctype html>
<html>
<body>
<h1 class="page-header">
Cab.ly
</h1>
<h2>
Driver Information
</h2>
@johnschimmel
johnschimmel / web.js
Created April 7, 2012 11:26
passport-foursquare setup with Mongoose
var express = require('express');
var ejs = require('ejs'); //embedded javascript template engine
var app = express.createServer(express.logger());
var mongoose = require('mongoose'); // include Mongoose MongoDB library
var schema = mongoose.Schema;
var requestURL = require('request');
//include passport-foursquare
var passport = require('passport')
, util = require('util')
@johnschimmel
johnschimmel / trackTime.js
Created April 25, 2012 20:59
track your time or get detention
var doSomethingForClient = function() {
// do something here
trackTime();
}
var trackTime = function() {
console.log("tracking my time!");
trackTime();
}
@johnschimmel
johnschimmel / olya_loops.js
Created May 1, 2012 12:04
Nested for loop example
<!-- Loop through each state, 's' is the incrementer value -->
<% for(s=0;s< states.length; s++) %>
<h4><%=states[s].toUpperCase()%></h4>
<UL>
<!-- Loop through allLegs for the current state, state[s] -->
<% for(i=0; i<allLegs[states[s]].length; i++) {%>
<li><%= allLegs[states[s]][i].title %></li>
/* Simple USB Keyboard Example
Teensy becomes a USB keyboard and types characters
REQUIREMENTS - Install the Teensyduino (arduino ide plugins)
http://www.pjrc.com/teensy/td_download.html
Before programming you must select Keyboard from the "Tools > USB Type" menu
This example code is in the public domain.
*/
@johnschimmel
johnschimmel / simplekeyboard-example
Created August 4, 2012 15:22
SimpleKeyboard for Arduino Leonardo
/*
Keyboard Button test
Sends a text string when a button is pressed.
The circuit:
* pushbutton attached from pin 2 to +5V
* 10-kilohm resistor attached from pin 4 to ground
created 24 Oct 2011
@johnschimmel
johnschimmel / gist:3603162
Created September 2, 2012 18:58
installing python 2.7.x
Installing Python 2.7.x
https://gist.github.com/3603162
***********************************************
Installing Python Setuptools
1) Download Python Setuptools
http://pypi.python.org/pypi/setuptools#downloads
@johnschimmel
johnschimmel / dwd_week_2_variables.py
Created September 11, 2012 14:16
python variables and space lesson
# a string
name = "John Young"
occupation = "Astronaut"
# an integer
age = 81
# float
days_in_space = 34.806
@johnschimmel
johnschimmel / dictionary_example.py
Created September 13, 2012 01:50
ITP DWD Week 2 - Dictionary Example
# create a dictionary
# mydict = { key1:value1, key2:value2 }
mission_dates = {
'Gemini 3' : '23 March 1965',
'Gemini 10' : '18-21 July 1966',
'Apollo 10' : '18-26 May 1969',
'Apollo 16' : '16-27 April 1972 ',
'STS-1' : '12-14 April 1981',
'STS-9' : '28 November - 6 December 1983'
}