Skip to content

Instantly share code, notes, and snippets.

View syoichi's full-sized avatar

Syoichi Tsuyuhara syoichi

View GitHub Profile
@airportyh
airportyh / jsconf_slides_codes_and_notes.md
Last active June 19, 2017 20:51
JSConf 2014 Slides, Codes and Notes.

JSConf Slides, Codes and Notes

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.

Modular frontend with NPM - Jake Verbaten (@Raynos)

@hail2u
hail2u / Gruntfile.js
Last active August 29, 2015 14:02
Gruntのバグ?
/* jshint node: true */
'use strict';
var path = require('path');
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
upload: {
@addyosmani
addyosmani / LICENSE.txt
Last active April 8, 2024 20:15 — forked from 140bytes/LICENSE.txt
Offline Text Editor in < 140 bytes (115 bytes). Powered by localStorage & contentEditable
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
"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);
@YungSang
YungSang / patch.model.gmail.tbrl.js
Last active August 29, 2015 14:01
[Deprecated] Taberareloo 用パッチ:Gmail の投稿時の URL が微妙に変わってた * Taberareloo v3.0.10 で対応済み
// ==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==
"use strict";
var TrieTree = function () {
this._root = new TrieNode(undefined);
Object.freeze(this);
};
TrieTree.prototype = Object.freeze({
/*
@annevk
annevk / gist:6bfa782752dde6acb379
Last active August 29, 2015 14:01
APIs that could move into ES

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
// ==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
@azu
azu / timeoutPromise.js
Created May 14, 2014 23:07
use reject not thorw
"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]);
// 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)