
Apparently, Opera 9 supports Server-Sent Events which you can read about in the WHATWG Web Applications 1.0 specification. Their demo application is a little chat program, which is a very obvious example of the technology.
There’s many times when I’ve wanted to add this to my applications: in Bugtagger I have to ask the service if a new message from a customer has been posted to a bug, every n seconds. It would be far more efficient for the serve to send a message using this technology.
And, since Opera’s so popular on embedded and mobile platforms, if this makes its way to mobile p…
Helipad is a little web notepad I wrote to throw to-do lists, notes, ideas and bits of code at. My idea was to make the perfect partner for my actual physical notepad.
Like everything I do, it has an API, and that allowed me to do something that I’ve found amazingly useful: load my vimrc remotely.
I know there’s a million other ways to do this, but I think it illustrates something unexpected and interesting that you can do with web application APIs. And, on the same topic, the AmbientClock uses your Google Calendar to change its colour according to how busy you are.
I’d love to h…
I needed a quick way of exporting data as zlib from a controller in Rails, so I came up with this:
def export
send_data compress_string(Document.find_all.to_xml), :filename => 'backup.xml.gz'
end
def compress_string(data)
gz = Zlib::GzipWriter.new(StringIO.new(''))
gz.write data
gz.close.string
rescue
gz.close
raise
end
Another way would be to use tempfiles with Tempfile—I wanted to benchmark and profile using files compared to StringIO, but that’ll be an exercise for another day.
This could also work nicely with Minitar.