Postgresql Leopard Gotchas →
After a fresh postgresql installation, initdb didn’t work until I reset the kern.sysv.shmall and kern.sysv.shmmax:
sudo sysctl -w kern.sysv.shmmax=134217728
sudo sysctl -w kern.sysv.shmall=65536
some problems, solutions, and other stuff i've encountered as a web developer
After a fresh postgresql installation, initdb didn’t work until I reset the kern.sysv.shmall and kern.sysv.shmmax:
sudo sysctl -w kern.sysv.shmmax=134217728
sudo sysctl -w kern.sysv.shmall=65536
My setup: Rails 2.1.2, Passenger 2.2.1, ruby-debug 0.10.3
move the django admin media files from _generated_media/1/admin to some directory inside the PROJECT_DIR:
1. move the admin dir to desired location, say PROJECT_DIR/admin_media
2. modify app.yaml urls to point to that static_dir location, e.g. add
- url: /admin_media
static_dir: admin_media
3. modify the MEDIA_URL and ADMIN_MEDIA_PREFIX in settings.py
MEDIA_URL = “/media/”
ADMIN_MEDIA_PREFIX = “/admin_media/”
We need to override MEDIA_URL so that when we access the media_url path from the templates, we don’t get the altered media_url (settings_post.py alters this by appending the MEDIA_VERSION by interpolating the %s. ADMIN_MEDIA_PREFIX is also based on the MEDIA_URL, but we want it to use /admin_media.wxpython from http://www.wxpython.org/download.php Unicode py2.5 build
sqlalchemy 0.5.3 via easy_install
phusion passenger 2.2 and nginx (installed via passenger)
All programmers are optimists. Perhaps this modern sorcery especially attracts those who believe in happy endings and fairy godmothers. Perhaps the hundreds of nitty frustrations drive away all but those who habitually focus on the end goal. Perhaps it is merely that computers are young, programmers are younger, and the young are always optimists.
— Frederick Brooks
From the to_csv plugin README, you can set the content type to text/csv in your rails controller action:
response.headers['Content-Type'] = 'text/csv; charset=iso-8859-1; header=present'
response.headers['Content-Disposition'] = "attachment; filename=users_#{Time.now.strftime("%m-%d-%Y")}.csv"
To RSpec this behavior, this works:
Then "the output should be a CSV" do
response.headers["type"].should have_text('text/csv')
end
If the cost premium for a more productive developer is less than the higher productivity of that developer, then it’s cheaper to hire the more expensive developer.
A notebook you can organize, back up and share!