Skip to content

Instantly share code, notes, and snippets.

@almonk
almonk / con.js
Last active August 29, 2015 14:12
function car() {
return {
start: function() {
console.log("Engine on.");
},
accelerate: function() {
console.log("Let's go!");
}
};
}
@almonk
almonk / usage_example.js
Created May 31, 2011 11:02 — forked from jgwhite/with-history.js
Simple pushState wrapper
$(document).bind("WithHistory.urlDidChange", function() {
$.ajax(window.withHistory.url(), {
dataType: "html",
success: function(response) {
var body = response.match(/<body.*?>([\s\S]+?)<\/body>/)[1];
var tmp = $("<div />");
tmp.html(body);
var newContent = tmp.find("#pagecontent").html();
$("#pagecontent").animate({ opacity: 0 }, 250);