Skip to content

Instantly share code, notes, and snippets.

View protestContest's full-sized avatar

Zack Michener protestContest

View GitHub Profile
var express = require('express')
, app = express.createServer()
, routes = require('./routes')
, redis = require('redis')
;
var app = module.exports = express.createServer();
app.listen(8080, function() {
!!!
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
script(type='text/javascript', src='/js/jquery.js')
script(type='text/javascript', src='/socket.io/socket.io.js')
script(type='text/javascript', src='/js/script.js')
body!= body
$(document).ready(function() {
console.log('connecting...');
connect();
});
function connect() {
console.log('connecting to ' + window.location.host);
var socket = new io.connect('http://' + window.location.host);
@protestContest
protestContest / object.js
Last active December 18, 2015 00:49
Javascript objects as JSON
// object:
function Person(yearsOld) {
// internal properties
var _Person
, age = yearsOld
, height = 71
, firstName = "Zack"
, lastName = "Michener";
// internal methods