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 | |
set -e | |
TIMEOUT=${TIMEOUT-60} | |
APP_ROOT="/usr/local/webapps/app_name/current" | |
PID="$APP_ROOT/tmp/pids/unicorn.pid" | |
RAILS_ENV=production | |
CMD="bundle exec unicorn -D -c $APP_ROOT/config/unicorn/production.rb -E $RAILS_ENV" | |
action="$1" |
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 | |
# | |
# MySQL バックアップスクリプト | |
# | |
# 指定された場所にバックアップを作成する | |
# 対象データベース | |
BACKUP_DB_NAME=testdb | |
DB_USER=user | |
DB_PASSWORD=pass |
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
# encoding: utf-8 | |
def hankaku_kana_only?(str, options = { allow_kogaki: true, allow_dakuten: true, allow_kigou: true }) | |
# 半角カナのコード範囲内の文字だけで構成されているか | |
return false unless str =~ /\A(?:[\xEF\xBD\xA1-\xEF\xBD\xBF]|[\xEF\xBE\x80-\xEF\xBE\x9F])+\Z/ | |
unless options[:allow_kogaki] | |
# 小書き文字が含まれていないか | |
return false if str =~ /(?:[\xEF\xBD\xA7-\xEF\xBD\xAF])/ | |
end | |
unless options[:allow_dakuten] |
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
require 'rubygems' | |
require 'active_support' | |
require 'mechanize' | |
require 'date' | |
require 'kconv' | |
# 配送状況取得 | |
# | |
# クロネコヤマトの荷物お問い合わせシステム | |
# http://toi.kuronekoyamato.co.jp/cgi-bin/tneko |