Skip to content

Instantly share code, notes, and snippets.

View RainerAtSpirit's full-sized avatar

Rainer Wittmann RainerAtSpirit

View GitHub Profile
@gsoltis
gsoltis / rx.firebase.js
Last active May 6, 2024 03:17
Quick Firebase / RxJS binding prototype
(function () {
var makeCallback = function(eventType, observer) {
if (eventType === 'value') {
return function(snap) {
observer.onNext(snap);
};
} else {
return function(snap, prevName) {
// Wrap into an object, since we can only pass one argument through.
observer.onNext({snapshot: snap, prevName: prevName});
@evanlarsen
evanlarsen / durandal.d.ts
Last active December 10, 2015 18:09
Durandal module declarations for Typescript
/// <reference path="../../libs/jquery/jquery.d.ts" />
/// <reference path="../../libs/knockout/knockout.d.ts" />
declare module "durandal/system" {
export var getModuleId: (obj: any) => string;
export var debug: (debug?: bool) => bool;
export var isArray: (obj: any) => bool;
export var log: (...msgs: any[]) => void;
export var defer: (action?: Function) => JQueryDeferred;
export var guid: () => string;
@michaelcox
michaelcox / SpecRunner.js
Last active January 11, 2024 06:05
Browser Unit Testing with Backbone Mocha Chai and RequireJS
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'