Skip to content

Instantly share code, notes, and snippets.

View grantmichaels's full-sized avatar

grantmichaels grantmichaels

View GitHub Profile
@grantmichaels
grantmichaels / app.js
Created May 13, 2012 20:50 — forked from ascruggs/app.js
Backbone JS infinite data with Node JS and Express JS
/*
** Client side - /public/src/app.js
*/
var myApp = {
// Collections
Collections: {
list: Backbone.Collection.extend()
},
// Views
@grantmichaels
grantmichaels / app.js
Created May 13, 2012 20:50 — forked from ag4ve/app.js
Simple blog with node.js, express and mongodb
var express = require('express'),
app = express.createServer(),
Post = require('./models/post');
app.configure(function () {
app.use(express.methodOverride());
app.use(express.bodyDecoder());
app.use(express.staticProvider(__dirname + '/public'));
app.use(express.compiler({src: __dirname + '/public', enable: ['sass']}));
app.use(express.logger());
@grantmichaels
grantmichaels / gist:2690116
Created May 13, 2012 20:49 — forked from johnschimmel/gist:1941724
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
@grantmichaels
grantmichaels / app.js
Created May 13, 2012 20:49 — forked from nulltask/app.js
Node.js network balanced cluster with Socket.IO
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, cluster = require('cluster');
var app = module.exports = express.createServer()
, io = require('./socket')(app);
@grantmichaels
grantmichaels / clone.sh
Created May 13, 2012 20:49 — forked from GarthDB/clone.sh
Use latest stable version of NodeJS on Heroku
$ git clone https://github.com/[your github username]/heroku-buildpack-nodejs.git
@grantmichaels
grantmichaels / app.js
Created May 13, 2012 20:48 — forked from poshaughnessy/app.js
Simple static site on Heroku with Node.js
var express = require('express');
var port = process.env.PORT || 3000;
var app = express.createServer();
app.get('/', function(request, response) {
response.sendfile(__dirname + '/index.html');
}).configure(function() {
app.use('/images', express.static(__dirname + '/images'));
}).listen(port);
@grantmichaels
grantmichaels / Procfile
Created May 13, 2012 20:33 — forked from vvakame/Procfile
most simple Node.js+CoffeeScript at Heroku
web: coffee app.coffee
@grantmichaels
grantmichaels / tropo nodejs outbound dial
Created May 13, 2012 20:30 — forked from chrismatthieu/tropo nodejs outbound dial
Create a Tropo outbound call using Node.JS
var sys = require('sys');
var http = require('http');
var tropoapi = require('tropo-webapi');
var server = http.createServer(function (request, response) {
var tropo = new tropoapi.TropoWebAPI();
tropo.call("+14803194368", {
network: "VOICE"
@grantmichaels
grantmichaels / HTTPServer.rb
Created May 13, 2012 20:29 — forked from pedromenezes/HTTPServer.rb
WebSocket Chat with Node.JS and Sinatra
require 'rubygems'
require 'sinatra'
get '/' do
'
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
@grantmichaels
grantmichaels / Node.js OpenTokSDK
Created May 13, 2012 19:09 — forked from bsstoner/Node.js OpenTokSDK
Node.js implementation of Tokbox's OpenTokSDK
/**
* Node.js implementation of Tokbox's OpenTokSDK
*
* by Brian Stoner
*
* var tokbox = require('./tokbox')
*
* var t = new tokbox.OpenTokSDK(API_KEY,API_SECRET)
*
* t.createSession('127.0.0.1', {}, function(session){