![]()
![]()
I'm Maxim Chernyak aka Hakunin. Every day I deal with three technologies - Ruby on Rails, Drupal, and Zend Framework. I deal and I blag. Natalie is my fiancée and I love her.
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 28 | 29 | 30 | 1 | 2 | 3 | 4 |
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 | 1 |
This tester_elf script is very dumb, which is uncharacteristic of elves in general. Why did I name it tester_elf? Well, it’s a Santa’s little helper type of elf as opposed to an individual of Tolkien’s highly cultural race. I do crave some nice D&D RPG experience but there aren’t any good new games in that direction. Everything gets dumbed down nowadays.
Anyhow, here’s the gist of it.
It just runs a test file every time you save it. Stupid but useful when autotest is too bulky. Instructions are in the gist.
Please welcome a new thingie I just released – yui_compressor_fu.
yui_compressor_fu delicately minifies all your assets (linked with javascript_include_tag, stylesheet_link_tag helpers) with YUI Compressor. It abides Rails caching rules. All you have to do is install the plugin, and minifying will automatically kick-in when rails performs its normal caching routines.
Today I was having my usual cup of Earl Grey with lemon while trying to find some JS/CSS minifying solution. Nowadays Rails provides built-in concatenation and caching, but not compression. I wanted to find something that transparently adds some minifying to the mix. Well, not so fast.
After flipping through quite a few choices, I wasn’t impressed at all. Available plugins either require too much configuration (why do I have to list all my assets again, asset_packager?) or they use inferior compression algorithms (Packer/MinJS). According to my research (don’t quote me) – YUI Compressor kicks some major ass. A few minutes of fruitless digging later I decided to make this plugin instead.
Feel free to try it out and let me know of any issues you encounter.
Today Rails gained a very interesting commit from h-lame. It’s the first major step towards making associations aware of their parent model while still in-memory. A few days ago I started this discussion which revealed to me that it had been a long time coming, just no one bothered.
Well, finally someone did. I would like to thank h-lame for making this commit happen. Here’s the excerpt from the commit message.
You can now add an :inverse_of option to has_one, has_many and belongs_to associations. This is best described with an example:
class Man < ActiveRecord::Base has_one :face, :inverse_of => :man end class Face < ActiveRecord::Base belongs_to :man, :inverse_of => :face end m = Man.first f = m.face
Without :inverse_of m and f.man would be different instances of the same object (f.man being pulled from the database again).
I didn’t find a quick short guide to installing sphinx on Leopard with PostgreSQL, hence here goes (this assumes you already installed PostgreSQL).
These two libs are required by sphinx according to this blog post.
~% mkdir src ~% cd src ~% curl -O http://ftp.gnu.org/gnu/libiconv/libiconv-1.13.tar.gz ~% tar xzf libiconv-1.13.tar.gz ~% cd libiconv-1.13 ~% ./configure --prefix=/usr/local ~% make ~% sudo make install ~% cd .. ~% curl -O http://internap.dl.sourceforge.net/sourceforge/expat/expat-2.0.1.tar.gz ~% tar xzf expat-2.0.1.tar.gz ~% cd expat-2.0.1 ~% ./configure --prefix=/usr/local ~% make ~% sudo make install ~% cd ..
At this point latest stable release was 0.9.8.1.
~% curl -O http://www.sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz ~% tar xzf sphinx-0.9.8.1.tar.gz ~% cd sphinx-0.9.8.1 ~% export LDFLAGS="-L/usr/lib" ~% ./configure --prefix=/usr/local --with-pgsql --without-mysql ~% make ~% sudo make install
You’re all set.