Skip to content

Instantly share code, notes, and snippets.

var PORT = process.env.PORT;
var http = require('http');
var server = http.createServer(function (req, res) {
res.writeHead(200, {"Content-Type" : "text/plain"});
res.end("hello world");
});
server.listen(PORT);
@cgack
cgack / storeHistory.js
Created August 25, 2011 02:30
store history and local storage ex
// store the canvas image and push to local storage
var storeHistory = function () {
img = canvas.toDataURL("image/png");
history.pushState({ imageData: img }, "", window.location.href);
if (window.localStorage) { localStorage.curImg = img; }
};
//retrieve local storage