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 part = require( 'part' ); | |
var _push = part._create( Array.prototype.push ); | |
// take, leave | |
var part = require( 'part' ); | |
var slice_ = part.create_( Array.prototype.slice ); | |
var take_ = slice_.bind( null, 0 ); | |
var apply_ = part.create_( Function.prototype.apply ); | |
var leave = function ( n ) { | |
return function ( fn ) { |
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
gulp.task( 'browserify', function () { | |
return browserify( './src/js/main.js' ) | |
.bundle() | |
.pipe( source( 'bundle.js' ) ) | |
.pipe( gulp.dest( './src/js/' ) ); | |
} ); | |
//Output scripts to main.js | |
gulp.task( 'scripts', ['browserify'], function () { | |
return gulp.src( './src/js/bundle.js' ) |
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 Promise = require( 'es6-promise' ).Promise; | |
function fn() { | |
return 1337; | |
} | |
function promise() { | |
return new Promise( function ( resolve, reject ) { | |
setTimeout( function () { | |
resolve( fn() ); |
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> | |
<html> | |
<head> | |
<title>My App</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | |
<meta name="mobile-web-app-capable" content="yes"> | |
<script src="../components/platform/platform.js"></script> | |
<link rel="import" href="my-app.html"> |
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 d = {id:'d', next:null}; | |
var c = {id:'c', next:d}; | |
var b = {id:'b', next:c}; | |
var a = {id:'a', next:b}; | |
function reverse( list ) { | |
var head = list.next; | |
var tail = list; | |
var next; | |
tail.next = null; |
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 logsArguments (fn) { | |
return function () { | |
//avoid illegal invocation in chrome | |
console.log.bind( console ).apply( this, arguments ); | |
return fn.apply(this, arguments) | |
}; | |
} | |
function Fubar (foo, bar) { | |
if ( !(this instanceof Fubar) ) { |
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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<polymer-element name="my-element"> |
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 satisfiesSpec( spec, parsedSpec, obj ) { | |
return spec === obj || | |
!!obj && | |
parsedSpec.obj.every( function ( key ) { | |
return spec[key] === obj[key]; | |
} ) && | |
parsedSpec.fn.every( function ( key ) { | |
return (key in obj) && spec[key]( obj[key], obj ); | |
} ); | |
} |
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 copy( prop ) { | |
var receiver, target; | |
function bindFrom( obj ) { | |
target = obj; | |
return copyProp(); | |
} | |
function bindTo( obj ) { | |
receiver = obj; | |
return copyProp(); | |
} |
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 constructor(spec) { | |
let {member} = spec, | |
{other} = other_constructor(spec), | |
method = function () { | |
// member, other, method | |
}; | |
return Object.freeze({ | |
method, | |
other | |
}); |
OlderNewer