Skip to content

Instantly share code, notes, and snippets.

View teppeis's full-sized avatar

Teppei Sato teppeis

View GitHub Profile
@teppeis
teppeis / md2cf.sh
Created September 11, 2014 04:15
Convert Markdown to Confluence
#!/bin/sh
# Convert Markdown to Confluence
#
# Supported syntax
# * heading (1-6)
# * blockquote (only single line ".bq")
# * code block fence (```)
# * inline code (`foo`)
# * link ([name](url))
@teppeis
teppeis / gist:16fcd61d30ee1df65944
Last active August 29, 2015 14:08
効率的なAST tool chainのご提案
@teppeis
teppeis / gist:dac50aa483b5a3b61599
Last active August 29, 2015 14:09
Closure Compiler failure list for es6-table

based on v20141023 result

arrow functions: no line break between params and =>

input

module.exports = function() {
    var f = x
        => 2;
    return f();
};
@teppeis
teppeis / gist:5c6a5ab42dd7d5a9930a
Created November 25, 2014 08:10
BrowserStack browsers
[
{
"browser_version": "11.1",
"device": null,
"browser": "opera",
"os_version": "Mavericks",
"os": "OS X"
},
{
"browser_version": "11.6",
@teppeis
teppeis / io.js.v0.12-370e821.txt
Last active August 29, 2015 14:11
ES6 compat table node v0.10 (w or w/o --harmony) vs. node v0.11 (w or w/o --harmony) vs. io.js v0.12 (370e821) https://docs.google.com/spreadsheets/d/1NM_zGzTODZt6pCW4mCB8c74KuyZLXhxUnGfQIHh5KD4/edit?pli=1#gid=0
✘ proper tail calls (tail call optimisation)
▼ arrow functions
✘ 0 parameters
✘ 1 parameter, no brackets
✘ multiple parameters
✘ lexical "this" binding
✘ "this" unchanged by call or apply
✘ can't be bound, can be curried
✘ lexical "arguments" binding
✘ no line break between params and =>
@teppeis
teppeis / gist:54cc85137e6b581a6f95
Last active May 18, 2017 02:35
Promise/非同期のテストを簡単にする新しいアサーションヘルパーのご紹介

Promise/非同期のテストを簡単にする新しいアサーションヘルパーのご紹介

この前のブログ記事見た人はごめん。

Promise/非同期のテストは難しい

どこが間違ってるか分かります?

@teppeis
teppeis / gist:5284739aa1c6823b2ea9
Created January 12, 2015 07:56
Object static methods that accept non object arguments in ES6
@teppeis
teppeis / gist:a48558a71a98d6bee6c9
Last active April 8, 2017 11:37
最近のFlowtype事情とReact+Flowtype連携

最近のFlowtype事情とReact+Flowtype連携

2015/01/15時点の情報です。

最近のFlowtype事情

v0.1.3が計画されてるけど、initial releaseのv0.1.0からはbugfixや細かな修正がほとんどで、大きな進化はしてない。 コミットもあまり活発ではない。 もしかしたら、Facebook社内でprivateブランチを育てていてまとまったところで出してくるのかも。 (JS等に比べて)開発者人口の少ないOCaml実装というのも、プルリクが集まりにくくOSS的な加速的進化が起きにくい原因かもしれない。

@teppeis
teppeis / gist:c50743a60832560aa1df
Last active April 29, 2023 15:04
Break the Web: Object staticメソッドがES6で仕様変更になった件について

Break the Web: Object static methods no longer throw errors for primitives!

Object.keys等のstaticメソッドがES6で挙動が変わったことで面倒なことになってる話

何が変わったか

ES5でプリミティブを受け取ると例外を投げていたObject.keys等のメソッドが、ES6では例外を吐かなくなった。

  • Object.getPrototypeOf ( O )
  • Object.getOwnPropertyDescriptor ( O, P )
/// <reference path="typings/node/node.d.ts" />
/// <reference path="typings/typescript/typescript.d.ts" />
import ts = require("typescript");
import fs = require("fs");
import path = require("path");
function transform(contents: string, libSource: string, compilerOptions: ts.CompilerOptions = {}) {
// Generated outputs
var outputs = [];