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 create(msg string) *appError { | |
var e appError | |
e.message = msg | |
e.frame = xerrors.Caller(2) | |
return &e | |
} | |
func New(msg string) AppError { | |
return create(msg) | |
} |
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 errors | |
import ( | |
"fmt" | |
"golang.org/x/xerrors" | |
) | |
// エラー構造体 | |
type appError struct { |
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
console.log('Loading function'); | |
const https = require('https'); | |
const url = require('url'); | |
const slack_url = 'https://hooks.slack.com/services/${ここにtoken}'; | |
const slack_req_opts = url.parse(slack_url); | |
slack_req_opts.method = 'POST'; | |
slack_req_opts.headers = {'Content-Type': 'application/json'}; | |
exports.handler = function(event, context) { |
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
aws s3 ls --recursive s3://{{ bucketName }}/ | awk '{print $4}' | xargs -P4 -I{} aws s3api put-object-acl --acl public-read --bucket {{ bucketName }} --key "{}" |
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
cd pairs.lv;git fetch > /dev/null;echo -n "https://eureka.atlassian.net/issues/?jql=project = PAIRS AND key in (";git log --oneline origin/${1}..origin/${2} | egrep -v "Merge pull request|Merge branch" | sed -e "s@^.\{8\}@@g" | egrep "^PAIRS" | sed "s/\(PAIRS-[0-9]*\).*/\1/g" | tr '\n' ',' | sed "s/,$//g";echo ") ORDER BY key ASC" |
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 | |
if [ "$2" = "message" -o "$2" = "" ] ; then | |
msg="`cat .git/COMMIT_EDITMSG`" | |
branch=`git symbolic-ref HEAD 2>/dev/null` | |
if [ ! -n "`echo "$branch" | sed -e "s/.*\///g" | sed -e "s/[0-9]//g"`" ] ; then | |
header="`echo $branch | sed -e "s/.*\/\([0-9]\+\)$/PAIRS-\1/g"` " | |
if [ "$header" = " " ] ; then | |
echo "$msg" > $1 | |
else |
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 blameを表示 | |
" 選択した状態で :S (押しやすいから) | |
function! GitBlameOnLineAndFile() range | |
:execute printf(':!git blame -L %d,%d %s | cat', a:firstline, a:lastline, expand("%:p")) | |
endfunction | |
command! -range S :<line1>,<line2>call GitBlameOnLineAndFile() |
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 | |
# show branches list & theses newest log -1 | |
branch="" | |
branches=`git branch --list` | |
while read -r branch; do | |
branch_name=${branch//\*\ /} | |
label=`git log -1 --pretty=format:'%s' $branch_name` | |
if expr "$branch" : "^[^\*].*" >/dev/null; then | |
echo -n " " |