hasen's tech life

Twitter: @hasen

コマンドラインでの表示に色を付けてSTG環境,本番環境を見分けられるようにしている.

# 相変わらずBashを使っている.
# コマンドラインでの表示に色を付けてSTG環境,本番環境を見分けられるようにしている.

$ vi ~/.bashrc
PS1='\n\[\033[1;34m\]\u \[\033[0m\]@ \[\033[0;31m\]本番\[\033[0m\]\n\[\033[1;36m\]\w/ \[\033[0m\]\n\[\033[0;31m\]$\[\033[0m\] '

古いメモがでてきたので,雑に貼る.

# 古いメモがでてきたので,雑に貼る.未検証.
# 最短マッチ
preg_match_all('/alt=".*?"/', HTML_DTATA_1, HTML_DATA_2, PREG_PATTERN_ORDER);

# IE9でplaceholderを使う
http://enjoy-pcworks.com/archives/104
https://code.google.com/p/complete-placeholder/をつかう
focusがはずれると黒丸になるので
ahはtype=password非対応
http://jamesallardice.github.io/Placeholders.js/はいけた
# IE8はダメっぽい
http://black-flag.net/jquery/20120321-3727.htmlがOK
autocomplete対策でIE9はon('change'
IE8はon('propertychange'

# LaravelをPostgreSQLで使うときの配列型の検索
->whereRaw('salon.genre @> ARRAY[' . $genre . ']')

MySQLでテーブル定義をCSV形式で出力した.

# MySQLでテーブル定義をCSV形式で出力した.

> select case ordinal_position when 1 then table_name else '' end, column_name, column_type, is_nullable, column_key, column_default, extra from information_schema.columns where table_schema = schema() order by table_schema, table_name, ordinal_position into outfile '/PATH/TO/OUTPUT.csv' fields terminated by ',';