Skip to content

Instantly share code, notes, and snippets.

View watilde's full-sized avatar
👋
Hi

Daijiro Wachi watilde

👋
Hi
View GitHub Profile
@rattrayalex
rattrayalex / MessageStore_FluxBone.js
Last active June 19, 2020 09:40
Flux and Backbone
var ChatAppDispatcher = require('../dispatcher/ChatAppDispatcher');
var ChatConstants = require('../constants/ChatConstants');
var ChatMessageUtils = require('../utils/ChatMessageUtils');
var EventEmitter = require('events').EventEmitter;
var ThreadStore = require('../stores/ThreadStore');
var merge = require('react/lib/merge');
var ActionTypes = ChatConstants.ActionTypes;
var CHANGE_EVENT = 'change';
@twada
twada / multi-stage-sourcemaps-strategy.md
Last active August 29, 2015 14:05
power-assert 多段 SourceMap 対応の方針

power-assert 多段 SourceMap 対応の方針

試験は twada/battlefield-sourcemaps で行っている

power-assert 出力行の補正

  • SourceMap 対応が入った espower 0.9.0 を使う
  • espower(ast, options) の第二引数 options に sourceMap というキーで上流の SourceMap オブジェクトを入れる
@netpoetica
netpoetica / Compiling v8 and Hello, World Example on Mac OSX Mavericks (10.9.4).md
Last active August 7, 2022 09:25
Compiling v8 and Hello, World Example on Mac OSX Mavericks (10.9.4), Link Clang to Static Libraries, properly configure your environment for v8 build

Compiling v8 and Hello, World Example on Mac OSX Mavericks (10.9.4)

by Keith Rosenberg (netpoetica)

Note: do this in some sort of project/ directory that makes sense. depot_tools are going to need to be in your path, so you may want to install them somewhere you are comfortable with.

1) Get the v8 source

git clone https://github.com/v8/v8.git

2) Install depot tools

@kuu
kuu / promises.md
Last active April 20, 2016 07:31 — forked from domenic/promises.md

This is a Japanese translation from the original Gist in English. 原文:You're Missing the Point of Promises by Domenic Denicola

====== この記事は私のブログでも掲載しています。また、記事中で Promises/A に言及している箇所がありますが、この記事が書かれた当時は Promises/A+の仕様がまだ存在しなかったので、少し古く感じられるかもしれません。

あなたの知らない JavaScript Promise

// applicationCacheの更新を妨害する
Object.defineProperty(this,'applicationCache',{get:function(){return{}}});
(function () {
// AppCache上でlocation.hrefを読み込むとAppCacheの内容を読み込むため、「ブラウザは別URLと認識するが、サーバは同じコンテンツを返すURL」を作る
contentLoad(location.href+'/');
// 本来であればsubmit等のイベントもキャッチする必要がある
window.addEventListener('click', function (evn) {
var elem = evn.target;
while (elem.tagName.toLocaleLowerCase() != 'a') elem = elem.parentNode;

http://d.hatena.ne.jp/gfx/20130521/1369159181 の追試。 as of JSX 0.9.89

title command size ratio
original jsx --release src/jsx-node-front.jsx | wc -c 1697 1.00
minify jsx --release --minify src/jsx-node-front.jsx | wc -c 364 0.21
gcc jsx --release src/jsx-node-front.jsx | closure-compiler | wc -c 703 0.41
gcc/A jsx --release src/jsx-node-front.jsx | closure-compiler --compilation_level ADVANCED_OPTIMIZATIONS | wc -c 345 0.20
@teppeis
teppeis / InferConsts.md
Last active August 29, 2015 14:02
What's InferConsts of Closure Compiler

InferConstsとは

このコミットで、実質的な定数をうまく推論できるようになった。(現在のmasterではデフォルト有効になっている)

以下のいずれかの条件を満たしたとき、その変数を定数とみなす。

  1. "well-defined"かつ一度しか代入されていない
  2. @const アノテーションが付いている
  3. const キーワードで宣言されている
  4. 命名規約によって定数であることがわかる
<div class="navbar-container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<i class="fa fa-bars"></i>
</button>
<a class="navbar-brand" href="/">
...
</a>
</div>
@otiai10
otiai10 / 艦これウィジェットに対するストアの見解.md
Last active August 29, 2015 14:01
艦これウィジェットに対するChromeウェブストアの見解

今回問題になりそうだったのは、2013年12月に新設されたChromeウェブストアの、通称single purposeポリシー参考記事)。「Chrome拡張やChromeアプリは、シンプルで分かりやすいただひとつの機能(または問題に対するソリューション)でなければならない」というもの。それゆえ「多機能のChrome拡張は分割実装しないと6月からストア公開を差し止めにするかもよー」という御触れが出ていて、一部Chrome拡張開発者はガクブルしていた。

以下のメール全文は、この件について「艦これウィジェットってちゃんとsingle purposeになってる?ねえどうなの?」ていう問い合わせに対する"Chrome Web Store Policy Team"からの返信です。


Dear Developer,

Thank you for contacting the Chrome Web Store Policy Team. Upon review, we’ve determined that your extension (url) is compliant with our extensions quality guidelines.

@hokaccha
hokaccha / sushi
Created April 30, 2014 07:52
Macのターミナルに寿司を降らせる
$ ruby -e 'C=`stty size`.scan(/\d+/)[1].to_i;S="\xf0\x9f\x8d\xa3";a={};puts "\033[2J";loop{a[rand(C)]=0;a.each{|x,o|;a[x]+=1;print "\033[#{o};#{x}H \033[#{a[x]};#{x}H#{S} \033[0;0H"};$stdout.flush;sleep 0.01}'