Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
8,743 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"predef": [ ] | ||
, "bitwise": false | ||
, "camelcase": false | ||
, "curly": false | ||
, "eqeqeq": false | ||
, "forin": false | ||
, "immed": false | ||
, "latedef": false | ||
, "noarg": true | ||
, "noempty": true | ||
, "nonew": true | ||
, "plusplus": false | ||
, "quotmark": true | ||
, "regexp": false | ||
, "undef": true | ||
, "unused": true | ||
, "strict": false | ||
, "trailing": true | ||
, "maxlen": 120 | ||
, "asi": true | ||
, "boss": true | ||
, "debug": true | ||
, "eqnull": true | ||
, "esnext": true | ||
, "evil": true | ||
, "expr": true | ||
, "funcscope": false | ||
, "globalstrict": false | ||
, "iterator": false | ||
, "lastsemic": true | ||
, "laxbreak": true | ||
, "laxcomma": true | ||
, "loopfunc": true | ||
, "multistr": false | ||
, "onecase": false | ||
, "proto": false | ||
, "regexdash": false | ||
, "scripturl": true | ||
, "smarttabs": false | ||
, "shadow": false | ||
, "sub": true | ||
, "supernew": false | ||
, "validthis": true | ||
, "browser": true | ||
, "couch": false | ||
, "devel": false | ||
, "dojo": false | ||
, "mootools": false | ||
, "node": true | ||
, "nonstandard": true | ||
, "prototypejs": false | ||
, "rhino": false | ||
, "worker": true | ||
, "wsh": false | ||
, "nomen": false | ||
, "onevar": true | ||
, "passfail": false | ||
} |
Binary file added
BIN
+45.8 KB
presentations/webdirections-code-2014/fonts/Century-Schoolbook-Monospace-BT.eot
Binary file not shown.
Binary file added
BIN
+90.2 KB
presentations/webdirections-code-2014/fonts/Century-Schoolbook-Monospace-BT.otf
Binary file not shown.
1,131 changes: 1,131 additions & 0 deletions
1,131
presentations/webdirections-code-2014/fonts/Century-Schoolbook-Monospace-BT.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+45.5 KB
presentations/webdirections-code-2014/fonts/Century-Schoolbook-Monospace-BT.ttf
Binary file not shown.
Binary file added
BIN
+47 KB
presentations/webdirections-code-2014/fonts/Century-Schoolbook-Monospace-BT.woff
Binary file not shown.
Binary file not shown.
Binary file not shown.
2,912 changes: 2,912 additions & 0 deletions
2,912
presentations/webdirections-code-2014/fonts/SignikaNegative-Bold.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added
BIN
+49.9 KB
presentations/webdirections-code-2014/fonts/SignikaNegative-Bold.woff
Binary file not shown.
Binary file added
BIN
+52.7 KB
presentations/webdirections-code-2014/fonts/SignikaNegative-Regular.eot
Binary file not shown.
Binary file added
BIN
+108 KB
presentations/webdirections-code-2014/fonts/SignikaNegative-Regular.otf
Binary file not shown.
2,937 changes: 2,937 additions & 0 deletions
2,937
presentations/webdirections-code-2014/fonts/SignikaNegative-Regular.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+52.5 KB
presentations/webdirections-code-2014/fonts/SignikaNegative-Regular.ttf
Binary file not shown.
Binary file added
BIN
+50.7 KB
presentations/webdirections-code-2014/fonts/SignikaNegative-Regular.woff
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
// some asynchronous function, could be anything conforming to the normal node callpath pattern | ||
|
||
function timer (callback) { | ||
setTimeout(function () { | ||
callback(null, new Date()) | ||
}, 1000) | ||
} | ||
|
||
// Linear congruential pseudo random number generator | ||
function* random (seed) { | ||
while (true) { | ||
var m = 25, a = 11, c = 17, z = seed; | ||
z = (a * z + c) % m; | ||
yield z; | ||
} | ||
} | ||
|
||
function* random (seed) { | ||
var m = 25, a = 11, c = 17, z = seed; | ||
while (true) { | ||
z = (a * z + c) % m; | ||
seed = yield z; | ||
if (typeof seed == 'number') | ||
z = seed | ||
} | ||
} | ||
|
||
console.log('gen') | ||
var gen = random(Date.now()) | ||
for (var i = 0; i < 10; i++) | ||
console.log(gen.next().value) | ||
console.log() | ||
|
||
var s = Date.now() | ||
var gen = random(s) | ||
console.log(gen.next().value) | ||
console.log(gen.next().value) | ||
console.log(gen.next().value) | ||
console.log(gen.next().value) | ||
console.log(gen.next().value) | ||
console.log(gen.next().value) | ||
console.log('seed', s) | ||
console.log(gen.next(s).value) | ||
console.log(gen.next().value) | ||
console.log(gen.next().value) | ||
console.log(gen.next().value) | ||
console.log(gen.next().value) | ||
|
||
// generator that yields async functions as a way of performing work | ||
|
||
function* gengen () { | ||
var v1 = yield timer | ||
console.log('v1', v1) | ||
var v2 = yield timer | ||
console.log('v2', v2) | ||
var v3 = yield timer | ||
console.log('v3', v3) | ||
return 'all done' | ||
} | ||
|
||
// a pre-ES6 version of the generator confirming to the general protocol | ||
|
||
function fakegen () { | ||
var c = 0 | ||
return { | ||
next: function (arg) { | ||
c++ | ||
switch (c) { | ||
case 1: | ||
return { value: timer }; | ||
case 2: | ||
console.log('v1', arg) | ||
return { value: timer }; | ||
case 3: | ||
console.log('v2', arg) | ||
return { value: timer }; | ||
case 4: | ||
console.log('v2', arg) | ||
return { done: true, value: 'all done' }; | ||
} | ||
} | ||
} | ||
} | ||
|
||
// generator async runner, simplistic form of 'co' | ||
|
||
function run (fn) { | ||
var gen = fn(); | ||
(function next (arg) { | ||
var it = gen.next(arg) | ||
console.log('got', it, 'passed', arg) | ||
if (it.done) | ||
return console.log('done', it.value) | ||
|
||
it.value(function (err, data) { | ||
next(data); | ||
}) | ||
}()) | ||
} | ||
|
||
// execute the generator function (uncomment one) | ||
|
||
//run(fakegen) | ||
run(gengen); | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48.3 KB
presentations/webdirections-code-2014/img/package-growth-comparison.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.