Wednesday, February 28, 2007

Tuesday, February 27, 2007

From: HowtoConfigureLogging on the Rails Wiki site.

Getting monochrome log messages

Removing the colour escape sequences that are used by default is quite
simple. Simply set colorize_logging to false:

ActiveRecord::Base.colorize_logging = false

Note that the colorize_logging method doesn't appear in
ActionController (why?[because the only module in rails that adds
color to the logs is ActiveRecord -jean]).
CryoPID - Freeze/Hibernate a process to disk and restore it later.

Wow, this is so cool, you could have a process running, freeze it to disk with CryoPID, then reboot the computer, and unfreeze the process.

Unfortunately, it doesn't yet handle my use-case, where I have an Emacs started with "screen". It'll be cool when that happens.

Sunday, February 25, 2007

Two very cool text editing tools for Firefox:

TextareaResize - is a Greasemonkey plugin that allows you to resize any text area by pressing Ctrl-Enter.

It's all Text is a Firefox plugin that gives you a little button "Edit" at the bottom of any text pane. When you click on it, you can edit your text in the editor of your choice. In my case, that would be Emacs, of course.

A circumzenithal arc.

Saturday, February 24, 2007

DHTML Goodies is some pretty sweet javascript/DHTML libraries, with really neat things like tabbed panes. Here's the >Reference manual for DHTML Goodies
Living on the edge with Rails

Edge Rails is the latest bleeding edge Rails version, I usually use stable, but needed to use Edge for a recent project. It's pretty simple, just go:

rake rails:freeze:edge
rake rails:update

and to check what version your server is running:

ruby script/about
Living on the edge with Rails

Edge Rails is the latest bleeding edge Rails version, I usually use stable, but needed to use Edge for a recent project. It's pretty simple, just go:

rake rails:freeze:edge
rake rails:update

and to check what version your server is running:

ruby script\about
Association Options :order.

In a recent project I needed to add a method to a Ruby on Rails model that would pull out the latest entry in a related table.

has_one :order => 'key'

worked great!

Thursday, February 22, 2007

I just got interviewed by Google! Trippy!

They ask REALLY hard questions.
Using Campfire for blog comments - Somewhere in this is a revolutionary idea, I'm not sure exactly where, but we're getting close to something very special. Imagine if your blog was more like a conversation with your users, and conversations could link not just to the inital post, but across other entries on your site, and to other sites. That combined with the idea of prescence, so that a reader can interact with other people reading the article at the same time. And now link that in with feeds. Somewhere in here is a new model of people interacting with people.

Sunday, February 18, 2007

Closures in Javascript
Capistrano and CakePHP in Perfect Harmony
Too many links open in Opera! Here they are for you, dear readers:

The Chemistry of Amino Acids - An excellent resource, tells you about all the different amino acids, with lots of detail.
What's Amazon's "Simple Storage Solution" (S3)? - S3 is something that rocks. I'm totally into it now, such a cool resource.
S3 backup tools - I'm using S3Fox quite a bit, but it's a bit broken. Need to fix it, if I have time.
Thread: Mounting S3 storage as a local file system w/ Jungle Disk
Jungle Disk download
Rasmus Lerdorf - PHP and Web2.0
Improved ways to suspend and hibernate a laptop under Linux
Water on Mars?
RFuzz - Test and break your own web applications. Kleenex optional.
Scruffy Graphs in Ruby.

Tuesday, February 13, 2007

I had a great time at the recent PHP Vancouver conference, it was really well done. I'm a totally Ruby fan, but I learned lots about performance of web applications at this conference. Rasmus Lerdorf gave a fantastic talk, and I really need to be doing:

http_load

and

valgrind/callgrind

Thursday, February 08, 2007

Another excellent post by Steve Yegge - This one about save-excursion and counting the characters in a buffer.

Tuesday, February 06, 2007

Getopt::Long - Getting long POSIX command line options with Perl.

Monday, February 05, 2007

I'm an avid listener of podcasts, and use the excellent peapod.py podcatching software. It runs from the commandline and is absolutely gorgeous. It uses an XML file for configuration, and to add files to it, I use Emacs and add a new:

<feed>
<url></url>
<title></title>
</feed>


to the end of the file. That's really sweet, and slightly hardcore.

To run it, I just have a crontab entry that runs at times when I'm usually not on the computer:

0 5,13,18 * * * /usr/sness/peapod/peapod.py >& /dev/null

So, when I wake up, come back from the gym, and after supper, there are podcasts all ready for me! So sweet.

I was reading the logfile for it recently, and was wondering what the following meant:

etag unchanged, not fetching: http://geekbrieftv.podshow.com/feed.xml

So, etags are actually really cool, here's RFC 2616 which describes it in detail. And a blog post about it.

Basically, etags are returned by the server in the content header, and tell you if the content of the page has changed or not. If it hasn't, you can add the If-None-Match header to your request, so that you don't have to download the URL if it hasn't changed. Sweet.