These are all the JSConf 2014 slides, codes, and notes I was able to cull together from twitter. Thanks to the speakers who posted them and thanks to @chantastic for posting his wonderful notes.
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
/* jshint node: true */ | |
'use strict'; | |
var path = require('path'); | |
module.exports = function (grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
upload: { |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Copyright (C) 2014 ADDY OSMANI <addyosmani.com> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
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
"use strict"; | |
var assert = require("power-assert"); | |
var sequence = require("../lib/promise-sequence").sequencePromises; | |
describe("promise-sequence", function () { | |
it("should sequence promises", function () { | |
var promisedIdentity = [1, 2, 4, 8, 16, 32].map(function (value) { | |
return function identify() { | |
return new Promise(function (resolve) { | |
setTimeout(function () { | |
resolve(value); |
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
// ==Taberareloo== | |
// { | |
// "name" : "Fix Gmail Model" | |
// , "description" : "Fix Gmail model" | |
// , "include" : ["background"] | |
// , "version" : "0.1.0" | |
// , "downloadURL" : "https://gist.github.com/YungSang/6c7447867ec8ac6c74b5/raw/patch.model.gmail.tbrl.js" | |
// } | |
// ==/Taberareloo== | |
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
"use strict"; | |
var TrieTree = function () { | |
this._root = new TrieNode(undefined); | |
Object.freeze(this); | |
}; | |
TrieTree.prototype = Object.freeze({ | |
/* |
Not really in any particular order. Some are more logical than others.
- TextDecoder / TextEncoder
- URL
- fetch() (unclear yet how we are going to namespace this, CORS behavior also does not make much sense outside browser context)
- Worker / SharedWorker (and all the port business, structured cloning is on its way already; would require events to be ported too)
- window.btoa() / window.atob()
- window.setTimeout(), …
- ImageBitmap
- EventSource
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
// ==UserScript== | |
// @id github.com-ff599db1-47d8-b14f-83b4-3e345f6d67e3@http://efcl.info/ | |
// @name Github:time-format-changer | |
// @version 1.0 | |
// @namespace http://efcl.info/ | |
// @author azu | |
// @description | |
// @include https://github.com/* | |
// @run-at document-end | |
// @grant none |
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
"use strict"; | |
var TimeoutError = require("./TimeoutError").TimeoutError; | |
var delayPromise = require("./delayPromise").delayPromise; | |
function timeoutPromise(promise, ms) { | |
var timeout = new Promise(function (resolve, reject) { | |
return delayPromise(ms).then(function () { | |
reject(new TimeoutError("Operation timed out after " + ms + " ms")); | |
}) | |
}); | |
return Promise.race([promise, timeout]); |
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
// Validation function called by couch vdu | |
function validName (name) { | |
if (!name) return false | |
var n = name.replace(/^\s+|\s+$/g, '') | |
if (!n || n.charAt(0) === "." | |
|| !n.match(/^[a-zA-Z0-9]/) | |
|| n.match(/[\/\(\)&\?#\|<>@:%\s\\\*'"!~`]/) | |
|| n.toLowerCase() === "node_modules" | |
|| n !== encodeURIComponent(n) |