June 2008
3 posts
April 2008
8 posts
Merb plugins (gems): merbful_auth: works, but terrible, terrible code. Do not use.
paperclip: Doesn’t work.
If ssh agent forwarding doesn’t work in capistrano, update your net-ssh gem.
If ssh agent forwarding doesn’t work in capistrano, update your net-ssh gem.
Given(“I am an activated, logged in user”) do
Given(“I am a user”)
Given(“I am activated”)
Given(“I am logged in”)
end
c[:session_store] = ‘memory’ if Merb.environment == “test”
Foo.class_eval do
def bar
puts “reopened class and replaced instance method”
end
end
Mocha can mock an instance method on all instances of a class. RSpec can’t.
You can take the boredom out of peepcode by running it at 1.5x speed using Quicktime.
January 2008
3 posts
RFC4366 (implemented in nginx, firefox 2, etc) makes it possible to run multiple SSL sites off a single ip/port
Forget sshfs; transmit is the best way to hack files on a live site.
rspec: integrate_views OR DIE!!
December 2007
5 posts
It’s going to be Monday morning until next Wednesday
Yeah, Radiohead’s recent release was great, but they forced you to sign up to a spam list just to buy it. If you email them asking to take you off, they don’t. Magnatunes.com has been doing the drm-free thing for years, and doesn’t spam you (or even require a valid email address).
Leopard desktop sharing: port 5901, vnc://
Used Yugma in production (view-only) - works fine.
November 2007
33 posts
Solaris: ps -Af
Yugma: Free, skype integration, full control, easy (java applet on a web page, so zero-install)… HILARIOUSLY slow.
glance.net : seems to be share-only (no control), still quite slow, fairly easy setup, costs money
yuuguu.com: Slightly harder to setup, free, still horribly slow.
Screen sharing: cross-platform, very easy, small install: copilot.com. Cons: expensive, very very very slow.
Eventmachine for simple socket ruby apps.
You can’t override initialize with ActiveRecord models. Instead, use the after_initialize callback.
Fast Resume: before I leave, I write down whatever I was working on. When I start in the morning I can find my context much faster.
I always forget how to easily update multiple models in a single rails form. Here it is:
tumblr_is_stupid fields_for ‘hubbub[]’,u do |user_fields| tumblr_is_stupid
tumblr_is_stupid user_fields.check_box :is_admin tumblr_is_stupid
tumblr_is_stupid end tumblr_is_stupid
Hubbub.update(params[:hubbub].keys.collect{|k| k.to_i},params[:hubbub].values)
I’ve had to replace...
icalx.com - ical sharing without .mac
sudo dscacheutil -flushcache (lookupd is gone in leopard)
http://rails.savvica.com/2007/11/6/email-veracity-plugin
On OSX, mysql log files are in the mysql data dir, probably /usr/local/mysql/data . Look for a file ending in .err. You can’t see them in /var/log, or the system log viewer (which is called Console.app, for some reason).
(Oh, and for what it’s worth, you *can* fit a bike in the back of a black cab. But it’s better to carry a spare tube)
How to fix your bike: http://www.sheldonbrown.com/canti-direct.html
(with instructions that are so good, I can follow them at 8am)
Using InnoDB, extended inserts (1000 records per instruction) are around 26 times faster than single inserts.
If you tell iTerm “unlimited scrollback buffer”, then run a 1000000 line .sql file inside a mysql shell, iTerm will use 1.5gb of memory and then crash. I want “[ ] unlimited scrollback, but don’t be stupid about it”
cd /usr/local/mysql; ./bin/mysqld_safe &
After a leopard install, your /etc/httpd.conf file is preserved but ignored. The real file is in /etc/apache2/httpd.conf. Note that spotlight won’t find this for you.
Leopard’s Terminal app finally supports tabs, but the tab name isn’t displayed in the tab (the command name is, instead). It’s no replacement for iterm.
Code formatting: Syntaxi / Syntax gem
Real Productivity by Gregory Brown →
“In this global community of hackers, we have limitless access to criticism from very smart people.”
Quicklook from command line:
cat ~/bin/ql
#!/bin/bash
qlmanage -p “$1” >& /dev/null
AAAH, but if you do that, when the app restarts all the stickies go back on the same space. No solution yet..
You can’t name leopard spaces, and you can’t use different backdrops. To tell them apart, put sticky notes on them using http://www.jimmcgowan.net/Site/StickEmUp.html
“We could not process your order because of geographical restrictions”
I was really trying to do the right thing. No wonder people pirate music.
To make any ruby script run in your rails environment, use script/runner, or add these lines to the top:
require File.dirname(__FILE__) + ‘/../config/boot’
require RAILS_ROOT + ‘/config/environment’
(You might need to do it that way if you’re using Daemonize)