Skip to content

Instantly share code, notes, and snippets.

View teppeis's full-sized avatar

Teppei Sato teppeis

View GitHub Profile
@teppeis
teppeis / gist:54cc85137e6b581a6f95
Last active May 18, 2017 02:35
Promise/非同期のテストを簡単にする新しいアサーションヘルパーのご紹介

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

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

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

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

@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的な加速的進化が起きにくい原因かもしれない。

var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}
@teppeis
teppeis / private.xml
Last active December 8, 2016 12:49
Karabiner settings for Microsoft Remote Desktop
<?xml version="1.0"?>
<root>
<appdef>
<appname>MicrosoftRDC</appname>
<equal>com.microsoft.rdc.mac</equal>
</appdef>
<symbol_map type="KeyCode" name="RDC_VK_HOME" value="0x73"/>
<symbol_map type="KeyCode" name="RDC_VK_END" value="0x77"/>
<item>
<name>Microsoft Remote Desktop App v8.0.14+</name>
@teppeis
teppeis / closure-compiler-v20160619-set-subclass.js
Created July 10, 2016 16:14
closure compiler output: Set is subclassable
var $jscomp = {scope:{}, getGlobal:function(a) {
return "undefined" != typeof window && window === a ? a : "undefined" != typeof global ? global : a;
}};
$jscomp.global = $jscomp.getGlobal(this);
$jscomp.initSymbol = function() {
$jscomp.global.Symbol || ($jscomp.global.Symbol = $jscomp.Symbol);
$jscomp.initSymbol = function() {
};
};
$jscomp.symbolCounter_ = 0;
@teppeis
teppeis / gist:d7f40170902a9a4144a2
Last active April 11, 2016 08:21
TypeScript用フルスタック型付きライブラリのご提案 (https://gist.github.com/teppeis/10659631 は間違えて消しちゃったので再投稿)
@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 / test.js
Last active February 16, 2016 17:51
TypeScript + power-assert + ES6 Modules issue http://qiita.com/wadahiro/items/5d8a81252f2105112339
// generated .js
var power_assert_1 = require('power-assert');
var _1 = require('../');
describe('foo', function () {
it('test #1', function () {
power_assert_1.default.ok(_1.default() === 2);
});
});

Untitled Slide

Welcome to Glide.

Glide is the easiest way to create useful slide for all of your Gists.

  • input key <- to go backward.
  • input key -> to go forward.

Publishing

// Auto clicking and optimal shopping for Cookie Clicker.
// http://orteil.dashnet.org/cookieclicker/
//
// Input this into developer console of your browser!
// You can stop with "stop()" in console.
var stop = (function(){
var def = [0.5, 0.5, 2, 10, 40, 100, 400, 6666, 98765, 999999];