Skip to content

Instantly share code, notes, and snippets.

Avatar
🐈
I love cats.

KUDO Ken-ichi ken1flan

🐈
I love cats.
View GitHub Profile
@ken1flan
ken1flan / gist:10826118
Created Apr 16, 2014
ginza.rb #10 ruby warrior
View gist:10826118
class Player
def play_turn(warrior)
# cool code goes her
if warrior.feel.wall?
warrior.pivot!
else
if warrior.feel.empty?
warrior.walk!
else
View .vimrc
set nocompatible
filetype off
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim
call neobundle#rc(expand('~/.bundle'))
endif
NeoBundle 'gmarik/vundle'
@ken1flan
ken1flan / delete_cap_releases
Created Aug 6, 2014
溜めすぎたcapistranoのリリースを削除する…capコマンドちゃんと使うべきだよ、本当は。
View delete_cap_releases
for d in `ls`; do if [ ${d} -lt 20140701000000 ]; then rm -rf ${d}; fi; done
@ken1flan
ken1flan / goto_work.sh
Created Aug 11, 2014
ワークディレクトリに移動するbash関数
View goto_work.sh
function goto_work () {
work_dir=~/work/`date +%Y%m%d`
if [ ! -d ${work_dir} ]; then
mkdir -p ${work_dir}
fi
cd ${work_dir}
}
@ken1flan
ken1flan / imagemagick
Created Oct 16, 2014
imagemagickで画像を一括置換
View imagemagick
OUTPUT_DIR=`pwd`/output
mkdir $OUTPUT_DIR
TMP_DIR=`pwd`/tmp
mkdir $TMP_DIR
for target in maternity family; do
cd $target
id=1
for file_name in `ls`; do
mv $file_name ${RANDOM}_${file_name}
done
@ken1flan
ken1flan / gist:051e0b5a1b60a59b154b
Last active Aug 29, 2015
VagrantでWindows上のVMWareにCentOS7をインストール、KVMをセットアップする
View gist:051e0b5a1b60a59b154b

vagrant にbox変換プラグインを追加

vagrant plugin install vagrant-mutate

vagrant に CentOS7のboxを登録

vagrant box add opscode_centos7_0 http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.0_chef-provisionerless.box
@ken1flan
ken1flan / fileext_sample.pl
Created May 6, 2015
ブラックリストに含まれる拡張子のファイルを検知
View fileext_sample.pl
#!/usr/bin/perl
@blacklist = qw(pl conf pm);
$filelist_str = <<EOF;
aaa/bbb/test.jpg
aaa/bbb/test.png
aaa/bbb/test.pl
aaa/bbb/test.pm
aaa/bbb/test.conf
@ken1flan
ken1flan / test.md
Last active Aug 29, 2015
テストのmd
View test.md

class: center, middle

Railsのインストール


コマンドラインツールをインストール

$ xcode-select --install
@ken1flan
ken1flan / git_prompt_for_bash_profile.sh
Created Oct 14, 2015
git プロンプト の bash_profile 設定
View git_prompt_for_bash_profile.sh
# for git
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
if [ -f "$(brew --prefix bash-git-prompt)/share/gitprompt.sh" ]; then
GIT_PROMPT_THEME=Default
source "$(brew --prefix bash-git-prompt)/share/gitprompt.sh"
fi
@ken1flan
ken1flan / kittenizer.rb
Last active Nov 24, 2015
文字列の猫語化
View kittenizer.rb
class String
def kittenize
result = self
DICTIONARY.each do |word|
result.gsub!(word[0], word[1])
end
end
def kittenize!
DICTIONARY.each do |word|
You can’t perform that action at this time.