Skip to content

Instantly share code, notes, and snippets.

View astrsk-hori's full-sized avatar

Go Horie astrsk-hori

  • 株式会社アスタリスク
  • tokyo
View GitHub Profile
@astrsk-hori
astrsk-hori / .zshrc_todo
Last active July 6, 2018 01:17
todo (use peco)
alias tcl="cat ~/.todo_history|nl"
alias tl="cat ~/.todo|nl"
alias te="vim ~/.todo"
alias td="remove-todo"
function remove-todo() {
TARGET=$(tl|peco)
NUM=$(echo $TARGET|cut -f1|tr -d ' ')
cat ~/.todo|sed -e "${NUM}d" >~/.todo_tmp
rm ~/.todo
@astrsk-hori
astrsk-hori / .zsh-open-alias
Created November 14, 2017 01:01
aliasを展開するzshコマンド
my-open-alias() {
if [ -z "$RBUFFER" ] ; then
my-open-alias-aux
else
zle end-of-line
fi
}
my-open-alias-aux() {
str=${LBUFFER%% }
@astrsk-hori
astrsk-hori / docker-compose.yml
Created January 20, 2016 10:51
docker-composeでmysql & postgreSQL をサクッと起動 ref: http://qiita.com/astrsk_hori/items/1e683a7a2f2b7189cb6e
# mysql ---------------------------------------------
datastore:
image: busybox
volumes:
- /opt/datastore:/var/lib/mysql
container_name: mysql-datastore
mysql:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: password
@astrsk-hori
astrsk-hori / file0.txt
Created January 8, 2016 08:02
Play Framework 2.4でURLの末尾スラッシュに対応 ref: http://qiita.com/astrsk_hori/items/19d1263c2747579b6057
GET /*path/ controllers.Application.untrail(path: String)
@astrsk-hori
astrsk-hori / proxy-env.sh
Created October 30, 2015 04:34
dockerイメージにproxy設定する。
#!/bin/sh
## http://qiita.com/speg03/items/4b8573686e7bbf218b61
## 上記から取得
if [ $# != 1 ]; then
echo "Usage: $0 DOCKER_IMAGE"
exit 1
fi
cat <<EOF | docker build -t $1 -
@astrsk-hori
astrsk-hori / proxy-onbuild.sh
Created October 5, 2015 04:12
dockerfileにproxyを適用
#!/bin/sh
## http://qiita.com/speg03/items/4b8573686e7bbf218b61
## 上記から取得
if [ $# != 1 ]; then
echo "Usage: $0 DOCKER_IMAGE"
exit 1
fi
cat <<EOF | docker build -t $1 -
docker pull mysql
docker run --name mysql -e MYSQL_ROOT_PASSWORD=mysql -d -p 3306:3306 mysql
# 接続確認 passwordはmysqlになります。
mysql -h $(boot2docker ip) -uroot -p
@astrsk-hori
astrsk-hori / file0.txt
Created April 22, 2015 05:29
laravelのfacadeのパーシャルモックのメモ ref: http://qiita.com/astrsk_hori/items/efe290554b497c565470
// File::delete()メソッド:
File::shouldReceive('delete')->andReturn(true);
File::makePartial();
composer create-project laravel/laravel la5test --prefer-dist
@astrsk-hori
astrsk-hori / file0.txt
Last active August 29, 2015 14:18
php書くときに知っといた方が捗るvimの使い方かも ref: http://qiita.com/astrsk_hori/items/9be32e0ad89a62ed4f8c
brew install ctags