Well, I’ve just learned there is built in support for calculating distance between two points. I wish I would knew… http://www.econym.demon.co.uk/googlemaps/dist.htm. Well – my code works for now, so I will leave it as is. Don’t fix what is not broken.
Monthly Archives: October 2006
Mixing h() helper and plain output in rhtml
Sometimes You need to generate output from .rhtml templates with HTML tags escaped mixed with real HTML tags. You can open and close Ruby code tags ( <%= <%=h ) but there is simpler method. In <%= block call h() helper directly. To work You need show correct name space – and this is ERB::Util::h().
Default values for function args in JS
It looks like JS has no default values for functions arguments. Of course there are some workarounds. Like http://web-graphics.com/mtarchive/001709.php or http://www.vivabit.com/bollocks/2006/01/09/cheeky-tip-default-function-arguments-in-javascript The second one has nicer look, at least IMO.
Ruby is nice language, but…
It won’t be about performance. It will be about documentation. Ruby is beautiful language and it gives a lot of fun when coding. But there is some wide gap between tutorials and standard library documentation. RDoc pages are very useful when You know exactly what to search for… But in case You know more that …
Memory usage for simple FreeBSD server
I’ve recently discovered, that anyone planning to run simple FreeBSD server for some standalone Internet domain (mail+AV+SpamAssassin, DNS, Apache+MySQL+PHP+WordPress) need at least 512 MB RAM (this server runs this, and some minor addons, and chocks with its 256 MB of RAM). I know that is small amount per today’s standards, but when You use as …