Skip to content

Instantly share code, notes, and snippets.

View mikesorae's full-sized avatar

Jumpei Nishina mikesorae

View GitHub Profile
@mikesorae
mikesorae / gist:bb39082f080c64445e37
Last active August 29, 2015 14:03
install anyenv system-widely
#!/bin/bash
cd /usr/local
git clone https://github.com/riywo/anyenv .anyenv
echo 'export PATH="/usr/local/.anyenv/bin:$PATH"' >> /etc/profile
echo 'export ANYENV_ROOT="/usr/local/.anyenv"' >> /etc/profile
echo 'eval "$(anyenv init -)"' >> /etc/profile
exec $SHELL -l
@mikesorae
mikesorae / 0_reuse_code.js
Created April 28, 2014 01:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mikesorae
mikesorae / hankaku.rb
Created March 16, 2014 17:33
全角カナ→半角カナ
require 'nkf'
# 既存の半角は維持しつつ全角カナを半角に変換
ARGF.each do |line|
# -xを付けないと既存の半角カナが全角になるぽい
puts NKF.nkf('-xw -Z4', line)
end
@mikesorae
mikesorae / gist:8050532
Created December 20, 2013 04:51
get uuid from provisioning profile
cat xxxx.mobileprovision | grep -A 1 -a UUID | grep "string" | sed -E "s/.*>([^<]*)<.*/\1/g"
#=> xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx
@mikesorae
mikesorae / gist:8050121
Created December 20, 2013 03:44
svn: get last changed revision
REVISION=`svn info | grep -i 'last changed rev' | grep -Eo [0-9]+`
@mikesorae
mikesorae / Makefile
Last active December 31, 2015 20:09
Xcode make file
# Build Settings
BUILD_PATH=build
CONFIGURE=Release
SCHEME=xxxxxxx
TARGET=xxxxxxx
# Settings for Sigining
PROVISION_NAME=xxxxxxx
CODE_SIGN="iPhone Distribution: xxxxxxx"
@mikesorae
mikesorae / gist:7800208
Last active December 30, 2015 08:08
調整さん日付出力用rubyスクリプト
# echoで指定した日付の範囲内で一覧を出力
echo 12/10 20:00..12/25 20:00 | ruby -r date -lne '$_.split("..").tap{|r| break DateTime.parse(r.first)..DateTime.parse(r.last)}.each{|d| puts d.strftime("%m/%d(%a) %H:%M~")}'
@mikesorae
mikesorae / gist:7730857
Created December 1, 2013 10:06
git filter branch for rename author and commiter
git filter-branch -f --env-filter "GIT_AUTHOR_NAME='__name__';
GIT_AUTHOR_EMAIL='__email__'; GIT_COMMITTER_NAME='__name__';
GIT_COMMITTER_EMAIL='__email__';"
@mikesorae
mikesorae / gist:6807406
Last active December 24, 2015 13:48
zero padding one-liner for underscore separated file name e.g. foo_1_bar.jpg foo_2_bar.jpg ↓ foo_001_bar.jpg foo_002_bar.jpg
ls | ruby -n -e '/([^_]*_)([^_]*)(_.*)/ =~ $_; puts "%s%03d%s"%[$1, $2, $3]'
@mikesorae
mikesorae / gist:6807238
Last active December 24, 2015 13:39
"internationalization" -> "i18n"
echo "internationalization" | ruby -lne 'p "#{$_[0]}#{$_.size-2}#{$_[-1,1]}"'