start new:
tmux
start new with session name:
tmux new -s myname
# in controller | |
# for local files | |
send_file '/path/to/file', :type => 'image/jpeg', :disposition => 'attachment' | |
# for remote files | |
require 'open-uri' | |
url = 'http://someserver.com/path/../filename.jpg' | |
data = open(url).read | |
send_data data, :disposition => 'attachment', :filename=>"photo.jpg" |
module AuthHelper | |
def http_login | |
user = 'username' | |
pw = 'password' | |
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw) | |
end | |
end | |
module AuthRequestHelper | |
# |
{# for twitter bootstrap specifically #} | |
{% block field_row %} | |
{% spaceless %} | |
<div class="control-group {% if errors|length > 0 %}error{% endif %}"> | |
{{ form_label(form, label|default(null)) }} | |
<div class="controls"> | |
{{ form_widget(form) }} | |
{{ form_errors(form)}} | |
</div> | |
</div> |
As configured in my dotfiles.
start new:
tmux
start new with session name:
# SQLite version 3.x | |
# gem install sqlite3-ruby (not necessary on OS X Leopard) | |
development: | |
adapter: sqlite3 | |
database: db/development.sqlite3 | |
pool: 5 | |
timeout: 5000 | |
# Warning: The database defined as "test" will be erased and | |
# re-generated from your development database when you run "rake". |