1. Put `crontab -l` into a file and add it into your repository
2. Add lines below to your config/deploy.rb
that's all. crontab on production server will be refreshed after every deployment.
rails + passengerでbasic認証
こんな感じでを追加してあげればOK。
LocationディレクティブはDirectoryディレクティブとは違ってウェブ空間に対する設定を行うので、/adminとか相対URLで指定できると。
.htpasswdの場所はホームディレクトリ以外がいいような…。
こちらを参考にしました!
Slicehost Forum - Passenger and htaccess, multiple login prompts
LocationディレクティブはDirectoryディレクティブとは違ってウェブ空間に対する設定を行うので、/adminとか相対URLで指定できると。
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName xx.xxx.xxx.xxx
ServerAlias xx.xxx.xxx.xxx
DocumentRoot /var/www/myapp/current/public
<Directory /var/www/myapp/current/public>
Options FollowSymLinks -MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Location /admin>
AuthUserFile /home/somebody/.htpasswd
AuthGroupFile /dev/null
AuthName "Please enter your ID and password"
AuthType Basic
require valid-user
</Location>
</VirtualHost>
.htpasswdの場所はホームディレクトリ以外がいいような…。
こちらを参考にしました!
Slicehost Forum - Passenger and htaccess, multiple login prompts
カレントディレクトリの*.erbを*.hamlに変換
Hamlいいですねー 楽です。キモ綺麗。
Hamlが動けばZen Codingいらず。
Haml同梱のhtml2hamlってコマンドでerbをhamlにできるのですが、ディレクトリ内一括でやっちゃたいのでちょっと工夫しました。
備忘もかねて投稿。
ただ、erb.html.erbとかいうファイル名があったらおかしくなっちゃいます。
Hamlが動けばZen Codingいらず。
Haml同梱のhtml2hamlってコマンドでerbをhamlにできるのですが、ディレクトリ内一括でやっちゃたいのでちょっと工夫しました。
備忘もかねて投稿。
ruby -e "Dir.glob('*.erb'){|erb|system \"html2haml #{erb} #{erb.sub('erb', 'haml')}\"}" ただ、erb.html.erbとかいうファイル名があったらおかしくなっちゃいます。
「開発者のキャリアプラン」は会社にとって損なだけ?
「アーキテクト」や「マネジメント」を目指すべきとされるキャリアプランに対して「ただいいものを作りたい」って答えると…上司が嫌な顔をする。そんなの無視するか、じゃなきゃ辞めちまえ、という反論に対して…
そう、誰かが辞めることは会社とって損害だと。
Weblogs Forum - Do Career Plans for Developers Actually Damage an Organisation?
and this takes me to my second point - does this actually damage the organisation because people start leaving or, worse, playing political games, feeling stressed or distracted by the things they have to do in order to live up to the career structure
そう、誰かが辞めることは会社とって損害だと。
Weblogs Forum - Do Career Plans for Developers Actually Damage an Organisation?
Enumerable.all?は空だと常にtrueを返す
ううむ…空集合の全てって一体何だ?
そして、安易なソリューション。
Enumerable - Rubyリファレンスマニュアル
irb(main):001:0> [].all?{false}
=> true
irb(main):002:0> [1].all?{false}
=> false
そして、安易なソリューション。
class Array
def not_empty_and_all?(&block)
return false if self.empty?
self.all? &block
end
end
Enumerable - Rubyリファレンスマニュアル
Labels:
ruby
Subscribe to:
Posts (Atom)
Author
Archive
Labels
- actionmailer (2)
- ActionView (2)
- activerecord (5)
- Ajax (1)
- apache (2)
- authlogic (2)
- awk (2)
- bash (4)
- block (1)
- cache (1)
- capistrano (1)
- crontab (1)
- Debian (1)
- deployment (1)
- design (2)
- design pattern (1)
- exception_notifier (1)
- factory_girl (2)
- firefox (1)
- flash (1)
- git (2)
- haml (1)
- html (1)
- javascript (5)
- jQuery (3)
- life (2)
- linux (3)
- lisp (2)
- mail (1)
- migration (1)
- mysql (2)
- Passenger (2)
- prototype.js (1)
- Rails (26)
- Rails3 (1)
- rake (1)
- restful_authentication (2)
- Rspec (3)
- ruby (10)
- rubygems (1)
- screen (1)
- script/console (1)
- Security (1)
- shouda (1)
- shoulda (3)
- subversion (2)
- sudo (1)
- tdd (1)
- testing (4)
- thunderbird (1)
- UI (1)
- unix (1)
- vim (3)
- work (1)
- xargs (1)
- xss (1)
- zsh (1)