$ mongoexport -d test -c activities | node event-convert-stream.js | mongoimport -d test -c events
This file contains 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
#!/bin/bash | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://gist.github.com/thrashr888/6047603/raw/6584ab9c5d500613303c852d79d619690b835305/install-redis.sh | |
# chmod 777 install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
echo "*****************************************" |
This file contains 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
app.set('port', process.env.PORT || 3000); | |
var host = process.env.HOST || 'localhost:'+app.get('port') |
This file contains 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 port = process.env.PORT || 3000 | |
, host = process.env.HOST || 'localhost:3000' |
This file contains 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 one = 1 | |
, two = 2 | |
, three = 3 | |
var one = 1, | |
two = 2, | |
three = 3; | |
var one = 1 | |
var two = 2 |
This file contains 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
/* Simple spam protection for email addresses using jQuery. | |
* Well, the protection isn’t jQuery-based, but you get the idea. | |
* This snippet allows you to slightly ‘obfuscate’ email addresses to make it harder for spambots to harvest them, while still offering a readable address to your visitors. | |
* E.g. Changed "at" to "atty" and "dot" to "dotty" to confuse some of the more intelligent harvesters. | |
* <a href="mailto:foo(atty)example(dotty)co(dotty)uk">foo aty example dotty co dotty uk</a> | |
* → | |
* <a href="mailto:[email protected]">[email protected]</a> | |
*/ | |
$(function() { |
This file contains 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 query = {$or: [ | |
{_id: req.params.id, app: req.app.id}, | |
{altId: req.params.id, app: req.app.id} | |
]} | |
Show.findOne(query, function(err, show) { | |
// send them the show | |
}) |
This file contains 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 Model = Backbone.SubCollectionModel.extend({ | |
collectionAttribute: 'dogs', | |
collectionToJSON: function(collection) { | |
return collection.pluck('name') | |
} | |
}) | |
var model = new Model({ | |
name: 'example', | |
dogs: [ |
This file contains 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
Watchlists.View = Backbone.Marionette.CompositeView.extend({ | |
template: Backbone.Marionette.TemplateCache.get('#watchlists-view'), | |
itemView: Watchlists.TableItemView, | |
itemViewContainer: 'tbody', | |
events: { | |
'submit .add-form': 'addWatchlist' | |
}, |
This file contains 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 schema = mongoose.Schema({ | |
lastUpdated: {type: Date, 'default': Date.now} | |
}) | |
schema.pre('save', function(next) { | |
this.lastUpdated = Date.now() | |
next() | |
}) |