Skip to content

Instantly share code, notes, and snippets.

View easierbycode's full-sized avatar

▓▒░ ♔ Daniel ♔ ░▒▓ easierbycode

View GitHub Profile
@easierbycode
easierbycode / manualcall.js
Created December 22, 2011 17:38 — forked from mxriverlynn/manualcall.js
search with backbone collections
var results = new SearchResults();
results.searchTerm = "some search term";
results.fetch({
success: someView.showTheResults
});
@easierbycode
easierbycode / timeout.js
Created December 22, 2011 01:24 — forked from mxriverlynn/timeout.js
Timeout
Foo = {};
Foo.bar = function(){
alert("test");
}
setTimeout(Foo.bar, 1000); // 1 second later, alert's "test"
/**
* Render templates.
*
* @param {String} The template to use `<p>Hello {{name}}</p>`
* @param {String} The data `{ name: 'Alex' }`
* @return {String} The rendered template
**/
function template(t, d) {
return t.replace(/{{([^}]*)}}/g, function(m, f, p, a) {
return d[f] || '';
@easierbycode
easierbycode / chat.html
Created October 27, 2011 17:44 — forked from JoeyButler/chat.html
Simple Chat app
<!DOCTYPE html>
<html>
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script>
<script>
$(document).ready(function(){
function debug(str){ $("#debug").append("<p>"+str+"</p>"); };
if(typeof WebSocket === 'undefined') {
alert("Your browser does not support websockets.")
}