Skip to content

Instantly share code, notes, and snippets.

View nanananamememe's full-sized avatar

nanananamememe nanananamememe

View GitHub Profile
@nanananamememe
nanananamememe / curl_loop.sh
Last active January 26, 2017 06:45
curlで同じURLをループして叩くshellスクリプト ref: http://qiita.com/nanananamememe/items/ad94d0ecb1b1e277f2fe
#!/bin/sh
URL="http://api.example.com/v1/hogehoge.json"; #接続先
HEAD="Content-Type:text/xml"; #リクエストヘッダー
DIR="."; #結果保存先ディレクトリ
for i in {0..100}
do
SETDT=`date "+%Y%m%d%H%M%S"`
curl -H $HEAD $URL > $DIR/$SETDT.txt;
#!/bin/sh
app="my_site";
mkdir $app
cd $app
git init
heroku create
echo '{}' > composer.json;
echo '<html><b>Hellow World!!</b> Yes we can!!</html>' > index.html
git add .
git commit -a -m first
<!DOCTYPE html>
<html lang="ja">
<head>
<meta http-equiv="content-language" content="ja">
<!-- 各自の環境に合わせて調整してね meta http-equiv="Content-Type" content="text/html; charset=UTF-8" -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script>
$(function(){
$('#error_text').on('change, keyup', function(){
$('#error_view').html($('#error_text').val());
#!/bin/sh
setdt=`date "+%Y%m%d%H%M%S"` // now date
newBranch="feature_honban_"$setdt // new release branch name
environment="hogehoge" // aws enviroment name
application="hogehoge" // aws application name
profile="hogehoge" // aws profile name
cherry="hogehoge" // cherry pick product configure
devBranch='hogehoge' // product branch name
if [ "$(uname)" == "Darwin" ]; then
startday=`date -j -f "%Y/%m/%d" "$2/01" "+%Y-%m-%d"`
endday=`date -v+1m -v-1d -j -f "%Y-%m-%d" "$startday" "+%Y-%m-%d"`
else
startday=`date -d "$2/01" "+%Y-%m-%d"`
endday=`date -d "$startday 1 month -1 day" "+%Y-%m-%d"`
fi
all=`git log --follow --author=$1 --stat --since=$startday --until=$endday . | grep "+\(+\|\-\)*$" | grep -v $3 | awk '{ins+=$3} END{print ins}'`
minus=`git log --follow --author=$1 --stat --since=$startday --until=$endday . | grep "[+-]\(+\|\-\)*\-$" | grep -v $3 | awk '{match($4, /\-+/);ins+=$3/length($4)*RLENGTH} END{printf("%d",ins)}'`
expr $all \- $minus
set wildmenu
set wildmode=longest:full
set tabstop=4
set shiftwidth=4
set autoindent
set expandtab
set softtabstop=0
set hlsearch
set ic
set ruler