Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| #make a hook | |
| store.hook 'change', 'collection.*.foo', (docId, value, op, session, backend) -> | |
| model = store.createModel() | |
| #logic | |
| #setup the hook method | |
| store.hook = (method, pattern, fn) -> | |
| store.shareClient.use 'after submit', (shareRequest, next) -> | |
| {opData} = shareRequest |
| var express = require('express') | |
| , mongoskin = require('mongoskin') | |
| var app = express() | |
| app.use(express.bodyParser()) | |
| var db = mongoskin.db('localhost:27017/test', {safe:true}); | |
| app.param('collectionName', function(req, res, next, collectionName){ | |
| req.collection = db.collection(collectionName) |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| var module = angular.module('racer.js', [], function ($provide) { | |
| var setImmediate = window && window.setImmediate ? window.setImmediate : function (fn) { | |
| setTimeout(fn, 0); | |
| }; | |
| var racer = require('racer'); | |
| $provide.factory('racer', ['$http', '$q', '$rootScope', function ($http, $q, $rootScope) { | |
| $http.get('/model').success(function (data) { | |
| racer.init(data); | |
| }); |
| public class ChildModelBindingPlugin : IPlugin | |
| { | |
| public void Register(IAppHost appHost) | |
| { | |
| appHost.RequestFilters.Add(RequestFilter); | |
| } | |
| static void RequestFilter(IHttpRequest req, IHttpResponse res, object requestDto) | |
| { | |
| requestDto = Bind(requestDto, req.FormData); |
| var interactive = new Miso.Storyboard({ | |
| // our initial state will be loading | |
| initial : 'loading', | |
| scenes : { | |
| loading: { | |
| enter : function() { | |
| // show that we are in a loading state | |
| $('#loading').show(); |
| requirejs.config({ | |
| shim: { | |
| 'foundation/jquery.foundation.topbar': { | |
| deps: ['jquery'], | |
| }, | |
| 'foundation/jquery.cookie': { | |
| deps: ['jquery'] | |
| }, | |
| 'foundation/jquery.event.move': { | |
| deps: ['jquery'] |
| /** | |
| * Moves a model to the given index, if different from its current index. Handy | |
| * for shuffling models about after they've been pulled into a new position via | |
| * drag and drop. | |
| */ | |
| Backbone.Collection.prototype.move = function(model, toIndex) { | |
| var fromIndex = this.indexOf(model) | |
| if (fromIndex == -1) { | |
| throw new Error("Can't move a model that's not in the collection") | |
| } |
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen" /> | |
| <!-- when.js Promises implementation --> | |
| <script src="https://raw.github.com/cujojs/when/master/when.js"></script> | |
| <!-- Unit testing and mocking framework --> | |
| <script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js"></script> |