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 PerfTime = require('perf-time'); | |
//var _ = require('underscore'); | |
var Perf = module.exports = function() { | |
this.startTime = null; | |
// this.t = new PerfTime(); | |
this.t = { | |
get: function() { | |
return Date.now(); | |
} |
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
// calling multiple callbacks for a promise | |
var promise = fnReturnsPromise(); | |
promise.then(fn1); | |
promise.then(fn2); | |
// that is not the same ? | |
fnReturnsPromise().then(fn1).then(fn2); | |
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
module.exports = function (grunt) { | |
multiTask: { | |
options: { | |
anObject: { | |
a: 1 | |
} | |
}, | |
target: { | |
options: { | |
anObject: { |
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 def1 = when.defer(); | |
var def2 = when.defer(); | |
def1.promise.then(function( arg1 ) { | |
arg1 === def2.promise; | |
}); |
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
<!-- The result of the popup window --> | |
<script>opener.ss.user.tw.oauthToken('token-312123123');close();</script> |
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
body { | |
background: blue; | |
padding:0; | |
} | |
header { | |
height: 200px; | |
background-color: red; | |
margin: 0; | |
display:block; | |
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
/** | |
* @externs | |
* @license MIT License (c) copyright 2011-2013 original author or authors | |
*/ | |
/** | |
* [when description] | |
* @param {[type]} promiseOrValue [description] | |
* @param {Function=} optOnFulfilled [description] | |
* @param {Function=} optOnRejected [description] |
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
@import "variables.less"; | |
@import "generated.less"; | |
@import "styles.less"; |
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"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
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
/** | |
* The beforeRender callback scaffolding. | |
* | |
* @param {Backbone.Layout} view The instance of the LayoutManager. | |
* @return {void} Don't care. | |
*/ | |
beforeRender: function( view ) { | |
console.log(view.template); // show the template of the view instance | |
// optionally beforeRender can be async |