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
var splitCommand = (function(){ | |
function State(text) { | |
this.args = []; | |
this.term = ''; | |
this.quot = null; | |
this.next = null; | |
['split', 'quoted', 'interm', 'escape'].map(function(m){ | |
this[m] = function(at){ | |
at++; |
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 main | |
import ( | |
"os" | |
kingpin "gopkg.in/alecthomas/kingpin.v2" | |
) | |
type Conf struct { | |
Hoge string `json:"hoge"` |
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
func do(ctx context.Context) (res *Result) { | |
defer func() { | |
if r := recover(); r != nil { | |
trace := make([]byte, 1024*10) | |
count := runtime.Stack(trace, true) | |
switch tr := r.(type) { | |
case error: | |
res = &Result{ | |
Err: tr, |
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 util | |
import ( | |
"encoding/json" | |
"errors" | |
"fmt" | |
) | |
// Errors : 複数のエラーを一括するエラー | |
type Errors []error |
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
brew list|grep -v '^lib' |while read line; do | |
echo -n ${line}$'\t' | |
brew info $line | grep '^http' | |
done | column -t -s $'\t' |
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 main | |
// Ellipsis a text | |
func Ellipsis(length int, text string) string { | |
r := []rune(text) | |
if len(r) > length { | |
return string(r[0:length]) + "..." | |
} | |
return text | |
} |
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
$ brew update && brew outdated # 更新が必要なパッケージの一覧を取得、確認。 | |
... | |
... | |
$ brew outdated \ | |
| awk '{print $1}' \ | |
| grep -v 'elasticsearch' \ | |
| grep -v 'mongo' \ | |
| xargs -n 1 brew upgrade |
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
owner= # 対象リポジトリ名(オーナー名)を設定 | |
repos= # 対象リポジトリ名を設定 | |
min_confidence=0.9 # 警告のレベル | |
head=$(git rev-parse --abbrev-ref @) # 現在のブランチを取得 | |
if [ -n "${head}" ] | |
then | |
# 現在のブランチをheadとするpull-requestを探す | |
base=$(gogh pr ls --repo ${owner}/${repos} --head ${owner}:${head} --state open --row-format $'{{.Base.Ref}}') | |
if [ -z "${base}" ] | |
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
[smtp.gmail.com]:587 [email protected]:hogehogehoge |
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
say "生"~&"死" |
OlderNewer