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
<!-- 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
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
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
// 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
var assert = require('chai').assert; | |
var when = require('when'); | |
var def1 = when.defer(); | |
function getProm() { | |
return def1.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
//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
module.exports = function (grunt) { | |
grunt.initConfig({ | |
watch: { | |
options: { | |
livereload: true | |
}, | |
// triggering livereload when the .css file is updated | |
// (compared to triggering when sass completes) | |
// allows livereload to not do a full page refresh | |
styles: { |
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 retProm() { | |
var def = when.defer(); | |
return def.resolve(); | |
} | |
console.log('one'); | |
retProm().then(function(){console.log('two')); | |
console.log('three'); |
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) { | |
require('load-grunt-tasks')(grunt); | |
grunt.initConfig({ | |
express: { | |
options: { | |
// Override defaults here | |
}, | |
web: { | |
options: { |