Skip to content

Instantly share code, notes, and snippets.

View oh-sky's full-sized avatar

Yoshihiro Ohsuka oh-sky

View GitHub Profile
@oh-sky
oh-sky / pre-commit
Created September 9, 2015 15:04
masterブランチへのコミットを禁止するgit-hook
#!/bin/sh
BRANCH=`git rev-parse --abbrev-ref HEAD`
if test $BRANCH = 'master'; then
echo 'Commiting to master is forbidden.'
exit 1
fi
@oh-sky
oh-sky / hello.pl
Created October 18, 2015 15:05
aws-lambda-hello-pl
print "Hello world.\n"
@oh-sky
oh-sky / hello.php
Created October 22, 2015 00:47
aws-lambda-hello-php
<?php
echo "Hello world.\n";
@oh-sky
oh-sky / gitwatcher.bash
Created December 15, 2015 13:36
git_kanshi_tool
#!/bin/bash
APP_DIRS=('/path/to/dir' '/path/2/dir')
for app_dir in ${APP_DIRS[@]}
do
cd $app_dir
number_of_changed=`git ls-files --modified | wc -l`
if test $number_of_changed -gt 0 ; then
curl -F text="$app_dir} 以下の${number_of_changed}個のファイルに変更がありました。確認してください。" -F channel= -F token='' https://slack.com/api/chat.postMessage
fi
@oh-sky
oh-sky / jobcan-shutsutaikin-henshu.js
Last active May 16, 2019 06:47
ジョブカンの出退勤編集画面の入力をサポートするジャバスクリプト(bookmarklet)
void((function() {
var editJikoku = function (jikoku) {
return function () {
var inputForm = jQuery(this);
if (inputForm.parents('tr').css('background-color') != 'transparent') {
return;
}
if (inputForm.val() != jikoku) {
inputForm.val(jikoku);
inputForm.css('background-color', '#fcc');