Requirements:
If you're on OSX you're probably best off using Homebrew to install this stuff:
$ brew install node mongodb
Usage:
| define([ | |
| 'backbone', | |
| 'underscore', | |
| 'project/views/form' | |
| ], function(Backbone, _, ProjectFormView) { | |
| var View = Backbone.View.extend({ | |
| events: { | |
| 'submit form': 'submit' | |
| }, |
| var View = Backbone.View.extend({ | |
| tagName: 'tr', | |
| template: Handlebars.compile($('#project-list-item').html()), | |
| events: { | |
| 'click .delete': 'destroy' | |
| }, | |
| initialize: function() { | |
| this.model.bind('change', this.render, this); | |
| this.model.bind('destroy', this.remove, this); |
| var touchHandler = function(handler) { | |
| return function(e) { | |
| handler.call(this, e.originalEvent.touches ? e.originalEvent.touches[0] : e); | |
| }; | |
| }; | |
| // Example | |
| $('foo').on('mousedown touchstart', touchHandler(function(e) { | |
| console.log('Touch/Mouse coordinates, top:', e.pageY, 'left:', e.pageX); | |
| }); |
| aggregator: bin/aggregator | |
| web: bin/app | |
| store bin/store |
| var http = require('http'), | |
| uri = require('url'), | |
| mime = require('mime'), | |
| aws2js = require('aws2js'); | |
| var settings = { | |
| s3: { | |
| key: 'cat', | |
| secret: 'bus', | |
| bucket: 'fonyfw', |
| Entry.findOne({type: 'photo', photo: null}).done(function(entry) { | |
| var thumbnailSize = entry.authorTypeName == 'Photographer' ? 500 : 250; | |
| var options = uri.parse(entry.photoUrl); | |
| var req = http.get(options, function(res) { | |
| if (res.statusCode != 200) return next(new Error('Could not fetch: ' + entry.photoUrl)); | |
| var type = res.headers['content-type']; | |
| var length = res.headers['content-length']; | |
| var extension = mime.extension(type); | |
| var path = settings.s3.path + entry._id + '.' + extension; |
| { "keys": ["super+8"], "command": "insert", "args": {"characters": "{"} }, | |
| { "keys": ["super+9"], "command": "insert", "args": {"characters": "}"} } |
| var LabeledMarkerOverlay = function(marker) { | |
| this.marker = marker; | |
| this.el = document.createElement('div'); | |
| this.el.className = 'marker-label'; | |
| }; | |
| LabeledMarkerOverlay.prototype = new google.maps.OverlayView(); | |
| LabeledMarkerOverlay.prototype.onAdd = function() { |
| // Create | |
| app.post('/api/attachments/stage', function(req, res) { | |
| var attachments = db.gridfs('attachments'); | |
| var file = attachments.create({ | |
| filename: shortid.generate() | |
| }); | |
| var stream = file.writeStream(); | |
| stream.on('close', function() { | |
| var attachment = { |