Skip to content

Instantly share code, notes, and snippets.

@wordijp
wordijp / node_modules\browserify-postcss
Last active December 29, 2016 14:21
Browserifyでのpostcss対応について
browserify-postcssのindex.jsを下記のように修正すればいける
※この方法はcssifyと同じ方法、ただしsassifyではhashを埋め込んでいない、理由は1ファイルへのバンドルをするためか?
しかしpostcssではpostcss-importとプラグインになっているため、必ずsassifyに準じる必要はないはず、
よって下記の方法は有効なはず。
しかし確信を持っていないため、gistという形でメモに残す。
```index.patch
--- index.js 2016-12-29 05:52:58.000000000 +0900
+++ index_hmr.js 2016-12-29 22:04:22.187971400 +0900
@@ -4,6 +4,8 @@
@wordijp
wordijp / .vimrc
Last active December 19, 2016 20:15
Windows版Vimでも動作するtagsファイル作成コマンド
" tagsファイルを.gitディレクトリへ作成する
" NOtE : .gitディレトリが、プロジェクトのルートディレクトリ取得も兼ねている
function! Make_tags_gitdir()
let l:toplevel = system('git rev-parse --show-toplevel')
if v:shell_error
echo 'failed: git dir is not found'
endif
let l:toplevel = substitute(l:toplevel, '[\r\n]', '', 'g')
let l:cache_pwd = ''
@wordijp
wordijp / README.md
Created December 2, 2016 06:30
Paper Plane xUIのモジュールを作る際のヘルパコマンド

ビルド & インストール

$ make
$ make test
test ok

生成されたppx-commandhash.exeをパスが通った場所に置く

使い方

@wordijp
wordijp / bench.sh
Last active October 28, 2016 08:46
Linuxカーネルソースのgrep、ripgrp(rg)、git grepベンチ用シェルスクリプト
#!/bin/sh
echo_and_do () {
echo $ "$1"
eval "$1"
}
echo ===============================================
echo grep, ripgrep, git grep benchmark\(by cygwin environment\)
echo ===============================================
@wordijp
wordijp / makefile
Last active October 20, 2016 09:13
-pオプションの無いWindowsで必要時だけフォルダを作成するmakefile
all: obj $(TARGET)
obj:
mkdir obj
$(TARGET): ...
# ここには含めない
.PHONY:
@wordijp
wordijp / path\to\.vim\bundle\vim-go\autoload\go\path.vim
Created October 12, 2016 19:59
Vim8.0のvim-goをWindowsで動くようにする
function! go#path#CheckBinPath(binpath)
" 省略
if executable(binpath)
if exists('*exepath')
let binpath = exepath(binpath)
+ let binpath = substitute(binpath, '\', '/', 'g')
endif
let $PATH = old_path
return binpath
@wordijp
wordijp / .sh
Created September 29, 2016 06:31
ディレクトリ内のファイルサイズが大きい順Top10を表示
# cygwinの場合
$ ls -la $(find . -type f) | sort -nr -k5 | awk -F' ' '{printf("%5s: %s\n",$5, $9)}' | head -10
公式も役立つ
https://github.com/nodejs/node-gyp
1. Visual C++ Build Toolsをデフォルトオプションのままインストール
2. Python2.7をインストール
3.
```
$ npm config set msvs_version 2015
$ npm config set python d:\path\to\python27\python.exe
```
@wordijp
wordijp / path\to\.vim\bundle\rust.vim\autoload\rustfmt.vim
Last active May 23, 2016 10:06
rust-lang/rust.vimのrustfmtを日本語を含むソースに対応させる
function! rustfmt#Format()
let l:curw = winsaveview()
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
- call writefile(getline(1, '$'), l:tmpname)
+ " keep file format
+ :execute ":w " . l:tmpname
# 環境変数
SHELLを/bin/zshへ
# .zshrc
# titleにパス
precmd() { eval 'echo -ne "\033]0;$PWD\007"' }