Skip to content

Instantly share code, notes, and snippets.

View knaka's full-sized avatar

Kiichiro-Kyle NAKA knaka

View GitHub Profile
cask_args appdir: "/Applications"
brew "curl"
brew "git"
brew "goenv"
brew "jq"
brew "openssl"
brew "mysql-client"
brew "pyenv"
brew "rbenv"
brew "tcptraceroute"
@knaka
knaka / deploy
Last active July 23, 2018 06:35
Create sample IAM Role, API Gateway REST API and Lambda Function.
#!/bin/bash
# -*- coding: utf-8 -*-
set -o nounset -o errexit -o pipefail
role_name=myLambdaRole
rest_api_name="Get Client Info"
stage_name="prod"
resource_path="/client_info"
function_name="getClientInfo"
@knaka
knaka / darwinbg
Last active May 12, 2016 09:38
Run processes while you do not touch your Mac.
#!/bin/bash
# -*- coding: utf-8 -*-
export PATH=/usr/local/bin:/usr/local/sbin/:/usr/bin/:/usr/sbin/:/bin/:/sbin/
## Avoid reentrance.
exec 9< $0
perl -mFcntl=:flock -e "open(LOCK,'<&=9');exit(!flock(LOCK,LOCK_EX|LOCK_NB))" || exit 0
## Exit for error or undefined.
function updateTable(tbl, cells) {
while (tbl.firstChild) {
tbl.removeChild(tbl.firstChild);
}
for (var i = 1; i < cells.length; i ++) {
var tr = document.createElement("tr")
tbl.appendChild(tr)
for (var j = 1; j < cells[i].length; j ++) {
if (cells[i] === void 0) {
continue
#!/bin/bash
# -*- coding: utf-8 -*-
# db=~/Library/Kobito/Kobito.db # DB path for older version of Kobito
db=~/Library/Containers/com.qiita.Kobito//Data/Library/Kobito/Kobito.db
dir=~/kobito/
encode_filename() {
name="$@"
name="${name//%/%37}"