Skip to content

Instantly share code, notes, and snippets.

View kitsuyui's full-sized avatar
🐢

kitsuyui kitsuyui

🐢
View GitHub Profile
@kitsuyui
kitsuyui / file0.txt
Last active September 18, 2017 05:34
備忘録: 最小限の労力でサブコマンド付きのシェルスクリプトが書きたい ref: http://qiita.com/kitsuyui/items/4b204963e0ebec53fe3c
$ some-command
Usage:
some-command --help
some-command sub-command1
some-command sub-command2
@kitsuyui
kitsuyui / file1.txt
Created September 18, 2017 04:56
備忘録: nginx でアクセス元 IP レンジに応じて Web アプリケーションを切り替える ref: http://qiita.com/kitsuyui/items/aefb3f301fd4f7004d81
$ sudo service nginx configtest && sudo service nginx reload
@kitsuyui
kitsuyui / TerminalVim.scpt
Created August 20, 2017 06:13 — forked from charlietran/TerminalVim.scpt
Open file in iTerm vim for MacOS Sierra
-- TerminalVim.app
-- This creates a shim Application that will enable you to open files from the Finder in vim using iTerm
-- To use this script:
-- 1. Open Automator and create a new Application
-- 2. Add the "Run Applescript" action
-- 3. Paste this script into the Run Applescript section
-- 4. Save the application as TerminalVim.app in your Applications folder
-- 5. In the Finder, right click on a file and select "Open With". In that window you can set TerminalVim as a default

Keybase proof

I hereby claim:

  • I am kitsuyui on github.
  • I am kitsuyui (https://keybase.io/kitsuyui) on keybase.
  • I have a public key ASAUotXpF9kKX5YzuBPC-8610qIFTCHSQJ6BQGhnhqFfhQo

To claim this, I am signing this object:

@kitsuyui
kitsuyui / (JavaScriptコード)
Last active January 3, 2017 12:06
macOS で textlint を右クリックのメニューから呼べるようにする ref: http://qiita.com/kitsuyui/items/07beca9ff6f04692bff5
this.run = (argv) => {
const app = Application.currentApplication();
app.includeStandardAdditions = true;
if (!argv[0]) {
app.displayAlert("OK");
return;
}
app.displayAlert(argv[0]);
};
@kitsuyui
kitsuyui / .env
Last active January 3, 2017 10:59
Python で画像や URL やリプライを含まない日本語のツイートを集める ref: http://qiita.com/kitsuyui/items/b30296f13f71b287f14f
#!/bin/sh
export APP_KEY='XXXXXXXXXXXXX'
export APP_SECRET='XXXXXXXXXXXXXXXXXXXX'
export OAUTH_TOKEN='XXXXX-XXXXXXXXXX'
export OAUTH_TOKEN_SECRET='XXXXXXXXXX'
@kitsuyui
kitsuyui / file0.txt
Last active December 20, 2016 14:27
Go のバイナリには -ldflags '-w -s' でコンパイルしてもたくさんパスが埋め込まれていた ref: http://qiita.com/kitsuyui/items/d03a9de90330d8c275c8
$ go build -ldflags '-w -s'
@kitsuyui
kitsuyui / file0.txt
Last active November 2, 2016 14:31
Docker で PostgreSQL の FDW を使って MySQL や Redis と JOIN してみた ref: http://qiita.com/kitsuyui/items/c2cd38daa78d1eb07a3c
FROM quay.io/aptible/postgresql:9.5-contrib
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install git gcc make libhiredis-dev \
&& mkdir -p /inst/ \
&& cd /inst \
&& git clone https://github.com/pg-redis-fdw/redis_fdw.git --branch REL9_5_STABLE --single-branch \
&& cd /inst/redis_fdw \
&& PATH=/usr/local/postgresql/bin/:$PATH make USE_PGXS=1 \
&& PATH=/usr/local/postgresql/bin/:$PATH make USE_PGXS=1 install \
@kitsuyui
kitsuyui / file0.txt
Created October 19, 2016 15:19
備忘録: docker run で `--restart=always` を付け忘れたコンテナに後から `--restart=always` をつけるには ref: http://qiita.com/kitsuyui/items/c6b5ff51e4902a91cc1d
$ docker update --restart=always コンテナのID
@kitsuyui
kitsuyui / file0.txt
Last active October 1, 2016 04:24
Homebrew で DNSCrypt を試してみる ref: http://qiita.com/kitsuyui/items/a75b45735a20a15c954a
$ brew install dnscrypt-proxy --with-plugins