Skip to content

Instantly share code, notes, and snippets.

View nnnnathann's full-sized avatar

Nathan Bleigh nnnnathann

  • Oberd
  • Kansas City, MO
View GitHub Profile
@nnnnathann
nnnnathann / 0_reuse_code.js
Created March 17, 2014 16:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
//main.js
require.config({
paths: {
jquery: 'components/jquery',
underscore: 'components/underscore',
backbone: 'components/backbone'
},
shim: {
jquery: { exports: '$' },
underscore: { exports: '_' },
-- This SQL implements the Double Metaphone algorythm (c) 1998, 1999 by Lawrence Philips
-- it was translated to Python, and then to SQL from the C source written by Kevin Atkinson (http://aspell.net/metaphone/)
-- By Andrew Collins - Feb, 2007 who claims no rights to this work
-- http://www.atomodo.com/code/double-metaphone/metaphone.sql/view
-- Tested with MySQL 5.1 on Ubuntu 6.01 and Ubuntu 10.4
-- Updated Nov 27, 2007 to fix a bug in the 'CC' section
-- Updated Jun 01, 2010 to fix a bug in the 'Z' section - thanks Nils Johnsson!
-- Updated Jun 25, 2010 to fix 16 signifigant bugs - thanks again Nils Johnsson for a spectacular
-- bug squashing effort. There were many cases where this function wouldn't give the same output
-- as the original C source that were fixed by his careful attention and excellent communication.
define(['backbone'],function(Backbone){
// Modified from from Backbone.Router v 0.9.2
var DelegatingRouter = function(args) {
if (!args.delegate) { throw("delegate is required arg to DelegateRouter"); }
if (!args.routes) { throw("routes is required arg to DelegateRouter"); }
Backbone.history || (Backbone.history = new Backbone.History);
_delegate_routes(this, args.delegate, args.routes);
// if (!Backbone.history.start({pushState: true})) {
// // window.location.href = "/404.html";