-
Collection#update
-
Collection#clone
-
once
-
Event Maps
-
History.extend
-
History outside of the browser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var path = require('path'); | |
var url = require('url'); | |
module.exports = function(directory, blacklist) { | |
if( directory === undefined ) { | |
throw new Error('You need to pass a location to work with'); | |
} | |
blacklist = blacklist || []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var logStream = { | |
write: function(msg){ | |
// strip duplicate newlines from the end of Express log messages | |
msg = msg.substr(0, msg.length - 1); | |
winston.info(msg); | |
} | |
}; | |
app.use(express.logger({ stream: logStream, format: 'dev' })); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16:38 Laybunz: Is there a way to get the name of a function on a Backbone view? | |
16:39 Laybunz: When I log out the function object itself in the console, it prints this: "function (){return n.apply(t,r.concat(o.call(arguments)))}" | |
16:39 Laybunz: Which is obviously a nameless anonymous function | |
16:55 scorchedwings: Laybunz - you're just doing a console.log(function_name) ? Can you use dev tools to look at the stack or set a breakpoint? | |
16:55 Laybunz: I'm hoping to have an array of filter or sort functions that a list is passed through | |
16:56 Laybunz: And I'd like to remove them by name programmatically, as well | |
16:56 Laybunz: Does that make sense? | |
16:57 scorchedwings: Laybunz - have you looked at the documentation for underscorejs? there are lots of methods there that are perfect for that. | |
16:58 Laybunz: I am using Underscore to actually execute the array of filter functions, and it works perfectly | |
16:59 Laybunz: Maybe there's another way to go about this, but in pseudocode I'd like to do something like this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Less Middleware | |
* | |
* Captures requests for your production css and serves a compiled less bundle | |
* in its place. Less parser is pretty quick, no noticeable load times when | |
* parsing bootstrap & custom less on every request. Errors are printed to the | |
* console. | |
* | |
* Meant to be mounted to your css directory, eg: | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
var hasAnyone = "ever seen someone write"; | |
function wtf(){ | |
return "code in blocks like this?"; | |
} | |
console.log( hasAnyone + wtf() ); |
By far the biggest release, Backbone 1.0 packs in a veritable menagerie of features, bug fixes and enhancements with a few breaking changes along the way. This is a brief overview of the release with tips on what to watch out for when upgrading from 0.9.2.
- Collection#update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!upstart | |
description "node server" | |
start on (local-filesystems and net-device-up IFACE=eth0) | |
stop on shutdown | |
script | |
export HOME="/home/sam" | |
exec sudo -u sam -i NODE_ENV=production /home/sam/local/node/bin/node /home/sam/dev/repos/wookiehangover.com/forever.js >> /var/log/node-server.log 2>&1 | |
end script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Model = function(){ | |
this.events = $({}); | |
this.attributes = {}; | |
}; | |
Model.prototype.set = function( key, value ){ | |
var self = this; | |
var events = []; | |
var cached_attributes = _.extend( {}, this.attributes ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global module:false*/ | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: '<json:package.json>', | |
lint: { | |
files: [ |