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
interface Array<T> { | |
flatMap<E>(callback: (t: T) => Array<E>): Array<E> | |
} | |
Object.defineProperty(Array.prototype, 'flatMap', { | |
value: function(f: Function) { | |
return this.reduce((ys: any, x: any) => { | |
return ys.concat(f.call(this, x)) | |
}, []) | |
}, |
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
(function(window) { | |
'use strict'; | |
var raf = window.requestAnimationFrame; | |
var CLOSESNESS = 2; | |
function startLoop(fn) { | |
var running = false; | |
var lastExit; |
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
(function(window) { | |
'use strict'; | |
window.SrcSet = { | |
/** | |
* Converts srcset value into JS objects | |
* e.g. './image1.jpg 1100w, ./image1_big.jpg 1500w, ./image1_small.jpg' | |
* yields: | |
* [ | |
* { src: './image1.jpg', width: 1100 }, |
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 alt = require('../alt'); | |
var TodoActions = require('./TodoActions'); | |
// Reactive data layer | |
var Todos = alt.Todos; | |
class TodoStore { | |
constructor() { | |
this.bindActions(TodoActions); |
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
<snippet> | |
<!-- Example: Hello, ${1:this} is a ${2:snippet}. --> | |
<content><![CDATA[ | |
import ipdb; ipdb.set_trace() | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>ipdb</tabTrigger> | |
<description>Set an ipdb breakbpoint with ipdb.set_trace</description> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.python, keyword.control.import.python</scope> |
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
<!doctype html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title></title> | |
<meta name="description" content=""> |
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 MyView = Marionette.ItemView.extend({ | |
listeners: { | |
model: { | |
'add': 'modelAdd' | |
}, | |
collection: { | |
'reset': 'reset' | |
}, | |
appVent: { |
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.module('ModuleOne', function(ModuleOne, App) { | |
var members = new Backbone.Collection(); | |
members.on('reset', function() { | |
App.vent.queueTrigger('moduleone:members:reset', members); | |
}); | |
members.fetch(); | |
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
/*! | |
* backbone.collectioncache.js v0.0.2 | |
* Copyright 2012, Tim Branyen (@tbranyen) | |
* backbone.collectioncache.js may be freely distributed under the MIT license. | |
*/ | |
(function(window) { | |
"use strict"; | |
// Dependencies |
NewerOlder