Skip to content

Instantly share code, notes, and snippets.

Yoshihiro Ohsuka oh-sky

Block or report user

Report or block oh-sky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mmm.md

girls テーブル

name alive_flag magical_flag
まどか 1 0
さやか 1 0
まみ 0 1
きょうこ 1 1
ほむら 1 1
@oh-sky
oh-sky / jobcan-shutsutaikin-henshu.js
Last active May 16, 2019
ジョブカンの出退勤編集画面の入力をサポートするジャバスクリプト(bookmarklet)
View jobcan-shutsutaikin-henshu.js
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');
View gitwatcher.bash
#!/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 / hello.php
Created Oct 22, 2015
aws-lambda-hello-php
View hello.php
<?php
echo "Hello world.\n";
@oh-sky
oh-sky / hello.pl
Created Oct 18, 2015
aws-lambda-hello-pl
View hello.pl
print "Hello world.\n"
@oh-sky
oh-sky / pre-commit
Created Sep 9, 2015
masterブランチへのコミットを禁止するgit-hook
View pre-commit
#!/bin/sh
BRANCH=`git rev-parse --abbrev-ref HEAD`
if test $BRANCH = 'master'; then
echo 'Commiting to master is forbidden.'
exit 1
fi
View upgradePHPandApache.sh
#!/bin/sh
sudo yum -y remove php php-common php-mysql php-mbstring php-cli php-gd php-soap php-pdo php-xml
sudo yum -y remove httpd httpd httpd-tools
sudo yum -y install httpd24 mod24_ssl
sudo yum -y install php55-common php55-mysqlnd php55-mbstring php55-cli php55-gd php55-soap php55-pdo php55 php55-xml
sed -i -e 's/;date\.timezone =/date\.timezone = "Asia\/Tokyo"/g' /etc/php.ini
sudo chkconfig httpd on
@oh-sky
oh-sky / topic-behind-checker.bash
Created Feb 26, 2015
トピックブランチのmasterからの遅れを調べる
View topic-behind-checker.bash
#!/bin/bash
REMOTE_NAME='origin'
git fetch --prune ${REMOTE_NAME}
msg=''
for remote_branch in `git branch -r | grep -v '\->'| grep ${REMOTE_NAME}/`
do
ahead=0
@oh-sky
oh-sky / AppController.php
Last active Aug 29, 2015
CakePHP2 defined methods of Controller
View AppController.php
App::uses('Controller', 'Controller');
AppController extends Controller {
public function __construct($request = null, $response = null) {
parent::__construct($request, $response);
// ここに書いた処理はComponent初期化より前に実行されます
}
public function startupProcess() {
// ここに書いた処理はComponent初期化より前に実行されます
// 親クラス(Controller)のstartupProcess()より前に書く必要があります。
@oh-sky
oh-sky / .emacs-display.el
Last active Aug 29, 2015
CakePHP2使いの.emacs
View .emacs-display.el
;;display settings
(tool-bar-mode nil) ;ツールバーを消す
(show-paren-mode t) ; 対応する括弧のハイライト
(display-time)
(setq-default truncate-lines t) ;右端で折り返さない
(setq-default truncate-partial-width-windows t) ;右端で折り返さない
;; 行番号
(global-linum-mode t)
(set-face-attribute 'linum nil
You can’t perform that action at this time.