This file contains hidden or 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
import view from './view'; | |
function myModuleView(viewModel) { | |
const config = { | |
model: viewModel, | |
template: tmpl, | |
... | |
} | |
return view(config); |
This file contains hidden or 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
# jspm install paperclip | |
import {transpile} from 'paperclip/lib/parsers/default/transpiler'; | |
export function translate(load) { | |
return 'module.exports = ' + transpile(load.source) + ';'; | |
} |
This file contains hidden or 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 async = require('async'); | |
require('colors'); | |
var CONCURRENCY = 5; | |
var S_BUILDING = ' Building '.bold; | |
var S_BUILT = ' Built '.green.bold; | |
function buildIt() { | |
console.log("Starting process with concurrency of ", CONCURRENCY); |
This file contains hidden or 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
/** | |
* Paths ending with / are no longer valid | |
*/ | |
gulp.task('migrate:jspm', function () { | |
gulp.src('src/**/*.js') | |
.pipe(replace(/[a-z\-_0-9]*\/'/gi, function (match) { | |
return match.substr(0, match.length - 1) + match.substr(0, match.length - 2) + '\''; | |
})) | |
.pipe(gulp.dest('src')) | |
}); |
This file contains hidden or 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
class Backbone.Group extends Backbone.Model | |
constructor: -> | |
@childCollection = new Backbone.Collection | |
super | |
class Backbone.Grouped extends Backbone.Model | |
## Override Me | |
childGroupBy: (model)-> |
This file contains hidden or 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
### | |
Here is a representation of a simple binary tree, | |
to illustrate the idea of using a self-calling function | |
to measure the length of a binary tree. | |
### | |
nodeMap = [ | |
[ | |
[ | |
[ |
This file contains hidden or 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
### | |
Helper functions | |
### | |
### | |
@function {getElementsByDataEl}: find and return elements by data-el attribute | |
@param {parent}: the DOM node to search through | |
@param {elements}: Array of data-el values to find | |
### |
This file contains hidden or 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
/* the function */ | |
fib = (x) -> | |
if x < 2 | |
x | |
else | |
fib(x-1) + fib(x-2) | |
/* test it out */ | |
solutions = [] | |
for number in [0..10] |
NewerOlder