This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https://gist.github.com/k2wanko/2217a7615b776a29d544 | |
branch=$(git branch | grep "*" | awk '{print $2}') | |
# if match , it return number only. if no match, it return branch name. | |
parse() { | |
target=$(cat -) | |
res=$(echo $target | sed -E -e "s/.*((#|issue[s]?[\/-_]?|_|-)([0-9]*)).*/\3/g") | |
if [ -n "$res" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Built application files | |
*.apk | |
*.ap_ | |
# Files for the Dalvik VM | |
*.dex | |
# Java class files | |
*.class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
root=`dirname $0`/.. | |
secret_dir=$root/.secret | |
suffix='.enc' | |
for target in $(find $secret_dir -name "*$suffix" ! -name ".*" -type f); do | |
file=$(echo $target | sed -e "s/.enc$//") | |
if [ -e $file ]; then | |
echo "Skip $file" | |
continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 開発環境 | |
必要なファイルをgitで管理して | |
ローカルで編集した後にrsyncでリモートでコピー | |
hook処理を入れてローカルのworking directoryとリモートのディレクトリは常に同期するようにした | |
設定ファイルのデプロイはシンボリックリンクを使い | |
サーバーの再起動はリモート側でシェルスクリプトを実行するようにした | |
# ボトルネックを確認する | |
DropboxのNginx.mdに書いてるisuconログフォーマットを使って |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
remote="" | |
user=$(git remote -v | grep push | awk '{print $2}' | sed -e "s/.*:\(.*\)\/.*/\1/") | |
repository=$(git remote -v | grep push | awk '{print $2}' | sed -e "s/.*docker-\(.*\)\..*/\1/") | |
target=$user/$repository | |
if [ -n "$remote" ];then | |
target=$remote/$target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rx.kotlin | |
import rx.Observable | |
import rx.Subscriber | |
import rx.Subscription | |
public fun <T> Observable<T>.onError(block : (Throwable) -> Unit): KSubscription<T> { | |
return KSubscription(this).onError(block) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CIRCLE_TOKEN="..." | |
CIRCLE_HOST="https://circleci.com/api/v1" | |
_circle_token="&circle-token=$CIRCLE_TOKEN" | |
open=$(which open) | |
function circle_projects() { | |
url="$CIRCLE_HOST/projects?${_circle_token}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
argv=("$@") | |
components="$(IFS=,; echo "${argv[*]}")" | |
echo y | ${ANDROID_HOME}/tools/android update sdk --no-ui --all --filter $components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
application=${APPLICATION:=$GAE_APPID} | |
branch=${BRANCH:=$(git rev-parse --abbrev-ref HEAD)} | |
token=$(gcloud auth print-access-token 2> /dev/null) | |
appcfg.py update --oauth2_access_token $token --application $application --version $branch . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.poi.poifs.crypt.Decryptor | |
import org.apache.poi.poifs.crypt.EncryptionInfo | |
import org.apache.poi.poifs.filesystem.POIFSFileSystem | |
import java.io.FileInputStream | |
import java.math.BigInteger | |
fun main(args: Array<String>) { | |
val inputStream = FileInputStream("/path/to/file.xlsx") | |
val fileSystem = POIFSFileSystem(inputStream) | |
val info = EncryptionInfo(fileSystem) |
OlderNewer