This file contains hidden or 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
class ChangeCollationOption < ActiveRecord::Migration | |
def up | |
execute "ALTER TABLE access_counters DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;" | |
execute "ALTER TABLE access_counters CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" | |
execute "ALTER TABLE access_tokens DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;" | |
execute "ALTER TABLE access_tokens CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" | |
execute "ALTER TABLE activities DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;" | |
execute "ALTER TABLE activities CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" | |
execute "ALTER TABLE admin_featured_users DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;" | |
execute "ALTER TABLE admin_featured_users CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" |
This file contains hidden or 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
"検索をファイルの先頭へ循環しない | |
set nowrapscan | |
"大文字小文字の区別なし | |
set ignorecase | |
"検索時に大文字を含んでいたら大/小を区別 | |
set smartcase | |
"検索対象をハイライト |
This file contains hidden or 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 -x | |
# ====================CONFIG THIS =============================== # | |
BACKGROUND_COLOR="#262626" # Background Color | |
FOREGROUND_COLOR="#94a3a5" # Text | |
COLOR_01="#282a2e" # HOST | |
COLOR_03="#8C9440" # COMMAND | |
COLOR_04="#de935f" # COMMAND_COLOR2 | |
COLOR_10="#cc6666" # COMMAND_ERROR |
This file contains hidden or 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 | |
if [ $# -lt 2 ]; then | |
echo "give HOST(~/.ssh/config), GROUP_ID(sg-xxxx) [, PROFILE(~/.aws/config)] as arguments" 1>&2 | |
echo "$ ssh_ec2 Hostname sg-groupid default" 1>&2 | |
exit 1 | |
fi | |
HOST=$1 | |
GROUP_ID=$2 |
This file contains hidden or 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
#NOTE: create id_hash for paperclip's url | |
# e.g) photo_id = 14721; format("%09d", photo_id).split("").each_slice(3).map{ |array| array.join("") }.join("/") | |
# # => "000/014/721" | |
id_hash = format("%09d", photo_id).split("").each_slice(3).map{ |array| array.join("") }.join("/") |
This file contains hidden or 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 | |
# set to repository/.git/hooks/prepare-commit-msg | |
# chmod +x prepare-commit-msg | |
COMMIT_EDITMSG=$1 | |
mv $COMMIT_EDITMSG $COMMIT_EDITMSG.tmp | |
number=`git branch | grep "*" | awk '{print $2}' | sed -e "s/^\([0-9]*\).*/\1/g"` | |
msg="" |
This file contains hidden or 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
#!/usr/bin/env ruby | |
message_file = ARGV[0] | |
message = File.read(message_file, :encoding => Encoding::UTF_8) | |
# remove prefix issue number like [#1234] from COMMIT_EDITMSG | |
message = message.sub(/^\[#[0-9A-Za-z_].*\]/, "") | |
# remove comment | |
message = message.gsub(/^#(?! ------------------------ >8 ------------------------).*\n|^\n/, "") |
This file contains hidden or 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
" Settings | |
set hud | |
set smoothscroll | |
"set noautofocus "The opposite of autofocus; this setting stops sites from focusing on an input box when they load | |
set typelinkhints | |
"chrome://extensions --> shortcut --> set ctrl+n as cvim's shortcut | |
set cncpcompletion | |
let searchlimit = 30 | |
let scrollstep = 150 | |
let barposition = "top" |
This file contains hidden or 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
BASE = "image_optim" | |
BASE_OPT = "--allow-lossy --recursive --no-progress" | |
JPEG_OPT = "--jpegrecompress-quality 0 --jpegoptim-max-quality 60" | |
PNG_OPT = "--no-pngout --no-pngcrush --no-optipng --no-advpng --pngquant-quality 20-40" | |
OTHER_OPT = "--gifsicle-level 3 --gifsicle-careful true --no-svgo" | |
image_optim ./* --allow-lossy --recursive --no-progress --jpegrecompress-quality 0 --jpegoptim-max-quality 60 --no-pngout --no-pngcrush --no-optipng --no-advpng --pngquant-quality 20-40 --gifsicle-level 3 --gifsicle-careful true --no-svgo |
This file contains hidden or 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
image_optim ./* \ | |
--allow-lossy --recursive --no-progress \ | |
--jpegrecompress-quality 0 --jpegoptim-max-quality 60 \ | |
--no-pngout --no-pngcrush --no-optipng --no-advpng \ | |
--pngquant-quality 20-40 \ | |
--gifsicle-level 3 --gifsicle-careful true --no-svgo |