Skip to content

Instantly share code, notes, and snippets.

View yoshi-taka's full-sized avatar

yoshi-taka

View GitHub Profile
@yoshi-taka
yoshi-taka / file0.txt
Last active October 24, 2016 14:14
MySQL権限一覧をきれいに作る方法と、rootユーザー以外で棚卸しする方法 ref: http://qiita.com/yoshi-taka/items/94467014ec7e9e3e8ec8
SELECT * FROM information_schema.user_privileges; -- グローバルレベル権限のリスト
SELECT * FROM information_schema.schema_privileges; -- データベースレベル権限のリスト
SELECT * FROM information_schema.table_privileges; -- テーブルレベル権限のリスト
SELECT * FROM information_schema.column_privileges; -- カラムレベル権限のリスト
@yoshi-taka
yoshi-taka / file0.txt
Last active August 29, 2015 14:07
ALTER TABLEでパーティションを作るときの地味な文法エラー ref: http://qiita.com/yoshi-taka/items/dcead31a1385374062db
ALTER TABLE users ADD COLUMN column1 INT, ADD COLUMN column2 INT, DROP COLUMN column3,
PARTITION BY RANGE COLUMNS(ID) (
PARTITION p1 VALUES LESS THAN MAXVALUE
)
@yoshi-taka
yoshi-taka / file0.sql
Created August 3, 2014 15:08
入力した条件だけが使われる検索(柔軟な検索)を1つだけのSQL Prepared Statementで書いてみる ref: http://qiita.com/yoshi-taka/items/f459303d349c00e1ed2d
SELECT column_a, column_b FROM a_table
WHERE column_a = COALESCE(?, column_a) AND column_b = COALESCE(?, column_b)
$><<%?\150\145\154\154\157\054\040\167\157\162\154\144?
@yoshi-taka
yoshi-taka / file0.bat
Last active July 5, 2016 17:03
Windows版Jenkinsを自動インストールする。ついでにプラグインも。 ref: http://qiita.com/yoshi-taka/items/3c8acae535c515a6d114
msiexec /i jenkins-x.xxx.msi /qn JENKINSDIR="path\to\jenkins"
@yoshi-taka
yoshi-taka / file0.bat
Created March 5, 2014 15:22
RubyInstallerをサイレントインストールせよ ref: http://qiita.com/yoshi-taka/items/a770b008f39ef7234e79
rubyinstaller.exe /dir="path\to\ruby" /verysilent /tasks=modpath /lang=ja
PS1="\`s=\$?;if [[ \$s -ne 0 ]];then echo -n \[\e[31m\]\$s\[\e[0m\];fi;if [ \$UID -eq 0 ];then echo \[\e[33m\];else echo \[\e[37m\] ;fi \`[\u@\h:\w]\$ \[\e[00m\]"
function source_if_exists(){
test -f "$1" && source "$1"
}
case $( uname -s ) in
AIX )
source_if_exists $HOME/.bash_aix ;;
Darwin )
eval$s=%w~a=->(b,c,d,e,f){%`#{(c)?"require'zlib';":''}g=Marshal.load(#{(c)?
'Zlib::Inflate.inflate(':''}'#{b}'.unpack('m')[0]#{(c)?')':''});h='eval$s=%
w'<<126<<($s*#{d});i='';j=-1;#{e*f}.times{|k|i<<(g[k]==1?h[j+= 1]:32);i<<
10if(k%#{e}==#{e-1}) };i[-7,6]=''<<126<<'.join' ;puts(i)#
`};$*[0]?(requi re'RMagick';include(M agick);l=
$*[0];m=($*[1] ||80).to
_i;n=QuantumRa nge*($*[
2]||0.5).to_f; o=ImageL
ist.new(l).fl atten_im
ages;p=o.colu mns;q=o.