Skip to content

Instantly share code, notes, and snippets.

View yukidarake's full-sized avatar
🎯
Focusing

Toshiyuki Nakamura yukidarake

🎯
Focusing
View GitHub Profile
@yukidarake
yukidarake / .gitignore
Created March 31, 2019 13:15
transpile lit-html to es5
/dist
@yukidarake
yukidarake / .gitignore
Last active January 13, 2016 11:43
coの使い方
node_modules
@yukidarake
yukidarake / event_loop.js
Created January 12, 2016 06:41
process.nextTickとsetImmediateの違いを理解する
'use strict';
var fs = require('fs');
console.log('start');
fs.readFile('./a.txt', function(err, data) {
console.log('readFile');
process.nextTick(function() {
console.log('readFile -> nextTick');
@yukidarake
yukidarake / esformatter.json
Last active November 11, 2015 08:23
esformatter用の設定例
{
"root": true,
"esformatter": {
"allowShebang": true
},
"indent": {
"value": " ",
"alignComments": true,
@yukidarake
yukidarake / msgpack.js
Last active August 29, 2015 14:27
Node.jsで使えるMessagePackライブラリのベンチマークをとってみた
'use strict';
var msgpack5 = require('msgpack5')();
var msgpack = require('msgpack');
require("uupaa.messagepack.js/lib/WebModule.js");
require("uupaa.messagepack.js/lib/MessagePack.js");
var uupaa = WebModule.MessagePack;
var msgpackjs = require('msgpack-js');
@yukidarake
yukidarake / private.xml
Created May 1, 2015 03:13
Vimでノーマルモードに戻るとき日本語IMEを自動OFFする(JISキーボード)KarabinerのMisc & Uninstallから設定
<?xml version="1.0"?>
<root>
<appdef>
<appname>iTERM2</appname>
<equal>com.googlecode.iterm2</equal>
</appdef>
<appdef>
<appname>MACVIM</appname>
<equal>org.vim.MacVim</equal>
</appdef>
@yukidarake
yukidarake / type-100million-chars-per-sec.md
Created October 29, 2014 10:01
仕事を高速でこなす方法

秒速で1億字叩く条件

秒速

きっかけ

naoya_itoの火を噴いたシェルtips
http://togetter.com/li/652438

キーリピート高速化

カーソル移動やバックスペースで文字を消すのが速くなります。

@yukidarake
yukidarake / tshark.sh
Created October 29, 2014 09:59
00:01:00:15・・・みたいなパケットキャプチャで取得した16進数を文字列に変換するワンライナー
tshark -r o.pcap -Y 'websocket' -T fields -e websocket.payload.binary_unmask | perl -nlE 'say map{pack('H2',$_)} split /:/'
@yukidarake
yukidarake / count.lua
Created October 15, 2014 02:13
Redisのキーのタイプを集計した時のスクリプト
-- Redis2.8以降ならSCANを使うのが正解だと思われる http://redis.io/commands/scan
-- 動作をブロックしちゃうので本番で使うのは要注意
local map = {}
local ks = redis.call('KEYS', '*')
for i, v in ipairs(ks) do
local key = string.match(v, '.-\-')
map[key] = (map[key] or 0) + 1
end