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
$(this).fadeOut('fast').queue(function() { | |
this.remove(); | |
}); |
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
# テーブル名から、定義されているすべてのカラム定義を取得 | |
Module.const_get('users'.classify).columns | |
# 特定のカラムの情報を取得(例えば `id`) | |
Module.const_get('users'.classify).columns['id'] | |
# 特定のカラムから定義の一部を取得 | |
col = Module.const_get('users'.classify).columns['id'] | |
col.type # データ型を取得 |
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
def get_id | |
return 256 | |
end | |
def get_name | |
return 'エナジー炭酸 がぶ飲み POWER SQUASH' # いまハマってる | |
end | |
# nameが欲しい | |
data_type = :name |
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
drop table if exists `utf8_bin`; | |
create table `utf8_bin` | |
( `id` int(11) NOT NULL auto_increment, | |
`str` varchar(255), | |
`num` int(11), | |
primary key (`id`) | |
) | |
engine=InnoDB | |
default character set utf8 collate utf8_bin | |
; |
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
$ rake routes | grep "users\|information" | |
confirm_user PATCH /users/:id/confirm(.:format) users#confirm | |
PUT /users/:id/confirm(.:format) users#confirm | |
confirm_users POST /users/confirm(.:format) users#confirm | |
users GET /users(.:format) users#index | |
POST /users(.:format) users#create | |
new_user GET /users/new(.:format) users#new | |
edit_user GET /users/:id/edit(.:format) users#edit | |
user GET /users/:id(.:format) users#show | |
PATCH /users/:id(.:format) users#update |
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
> Time.now.to_s | |
=> 2014-03-03 15:21:57 +0900 |
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
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 32 | sort | uniq |
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
find . -type f -print | xargs grep -l hoge | xargs sed -i "s/hoge/bar/g" ; |
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
$ sudo aptitude install libgtk2.0-dev libXpm-dev libjpeg8-dev libgif-dev libtiff4-dev libncurses5-dev libgtk-3-dev libgnutls-dev libselinux1-dev libmagick++-dev |