#Installation#
First you'll need [dnsmasq][1], assuming you're on OSX installation is simply:
brew install dnsmasq
#Configuration#
Add 127.0.0.1 to to the top of your DNS server list in your Network Configuration:
| update: function() { | |
| var filter = (function(filters) { | |
| var attributes = filters.groupBy(function(filter) { | |
| return filter.get('attribute'); | |
| }); | |
| return function(model) { | |
| return _.every(attributes, function(filters, attribute) { | |
| var value = model.get(attribute); |
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>Backbone Routing Example</title> | |
| <meta charset="utf-8"> | |
| </head> | |
| <body> |
| _.extend(Backbone.Router.prototype, { | |
| _routeToRegExp: (function() { | |
| var namedParam = /:\w+/g; | |
| var splatParam = /\*\w+/g; | |
| var escapeRegExp = /[-[\]{}()+?.,\\^$|#\s]/g; | |
| return function(route) { | |
| var pattern = route.replace(escapeRegExp, '\\$&') | |
| .replace(namedParam, '([^\/?]*)') | |
| .replace(splatParam, '([^\?]*)') |
| var spawn = require('child_process').spawn, | |
| aws2js = require('aws2js'), | |
| http = require('http'), | |
| urlutil = require('url') | |
| mime = require('mime'), | |
| Buffers = require('buffers'); | |
| var settings = { | |
| s3: { | |
| key: 'key', |
| (function($) { | |
| var observer = $({}); | |
| $.subscribe = function(topic, handler, context) { | |
| observer.on(topic, $.proxy(handler, context)); | |
| }; | |
| $.unsubscribe = function(topic, handler, context) { | |
| observer.off(topic, $.proxy(handler, context)); | |
| }; |
| App.CartItem = Backbone.Model.extend({ | |
| url: App.settings.apiBaseUrl + '/cart', | |
| sync: function(method, model, options) { | |
| if (method == 'delete') { | |
| method = 'read'; | |
| options.url = this.url + '/removeItemInCart'; | |
| options.data = { | |
| item_id: model.id | |
| }; |
#Installation#
First you'll need [dnsmasq][1], assuming you're on OSX installation is simply:
brew install dnsmasq
#Configuration#
Add 127.0.0.1 to to the top of your DNS server list in your Network Configuration:
| update: (function() { | |
| var $wrapper = this.$('.wrapper'); | |
| var $container = $wrapper.find('.slides'); | |
| var $slides = $container.children(); | |
| var $window = $(window); | |
| var slideWidth = $slides.first().width(); | |
| var easing = 'easeOutExpo'; | |
| var duration = 150; |
| Cart = Backbone.Model.extend({ | |
| initialize: function() { | |
| this.tags = new Backbone.Collection(); | |
| }, | |
| sync: function(method, model, options) { | |
| if (method == 'create' || method == 'update') { | |
| options.data = model.tags.reduce(function(memo, tag) { | |
| memo[tag.id] = tag.get('value'); |
| DefaultMimeTypes = { | |
| "ai" => "application/postscript", | |
| "asc" => "text/plain", | |
| "avi" => "video/x-msvideo", | |
| "bin" => "application/octet-stream", | |
| "bmp" => "image/bmp", | |
| "class" => "application/octet-stream", | |
| "cer" => "application/pkix-cert", | |
| "crl" => "application/pkix-crl", | |
| "crt" => "application/x-x509-ca-cert", |