Wednesday, March 12, 2008

Posting binary data using ruby

data = File.read('sample.xml')
url = URI.parse('http://localhost:3000/update')
http = Net::HTTP.new(url.host, url.port)
response, body = http.post(url.path, data, {'Content-type'=>'text/xml;
charset=utf-8'})

Monday, February 18, 2008

Code: Auto-thumbnail using Magick


def auto_thumbnail
@board = Board.find(params["id"])
pic = Magick::Image.read(@board.thumbnail_image).first
thumb = pic.resize(200, 145)
@response.headers["Content-type"]= thumb.mime_type
render :text => thumb.to_blob
end

Sunday, October 14, 2007

C++ web application framework

WT (pronounced "witty") is a web application framework for C++ developers. Hmnnn.. this looks interesting, I wonder you guys out there knows of an ORM for C++ that I can use to complement this framework. I might use it for my own small web application someday (small memory footprint and speed the main driving force in using this one).

Update:
I just found a C++ ORM - DTL (Database Template Library). Has somebody used this one in production environment? What was your experience?

Skype for windows written in Delphi?


TIL Skype was coded in Delphi -- link.  I did some Delphi programming back then and really loved the IDE.  #reminiscing

Tuesday, September 25, 2007

Mercurial

I just completed the testing of a new versioning tool for breakout (http://www.assembla.com), previously we are offering only SVN, I'm pleased to tell you that we are going to support Mercurial as one of the versioning tools we are offering. It is not yet live but hopefully this coming weeks it will!

A couple of things that bite me during my testing. First, the installation of mercurial itself on my development box (Ubuntu Linux). When I ran "hg debuginstall" I got this "mpatch" extension error. What I did was ran the following command "make local" (you can read the instruction from the mercurial website). After issuing the command "hg debuginstall" no longer reports the error.

Note to self:
hg pull - updates working copy
hg -m then hg push - Commits changes to the repository
hg add - adds the new files on the next commit
hg commit - commit outstanding changes
hg remove - removes the specified file on the next commit.

Tuesday, August 21, 2007

Taking new road

For 2 1/2 years working here in Singapore as a contract software developer, I've decided I'm done, this is not the type of job I was aiming for. The salary was better, way better than what I have earned previously in Cebu. But there's one key component missing -- passion. Passion for the things you are doing. Everyday doing the job is uninteresting, tedious, boring and mundane at best, every time I woke up, the first thing that comes to mind is "Should I take a leave"? I miss the times when working don't feel like working at all because you are having so much fun doing it. In a couple of days I'll be coming back to Cebu, this time I'll be working for a US startup company and will be doing a lot of Ruby on Rails development. This might be it -- the career that I've always wanted, a nice salary, a nice place to stay and working on a job that I loved.

Saturday, September 23, 2006

List of nice mac softwares

* parallels
* quicksilver
* textmate
* adium
* rapidweaver
* desktopia
* sidenote
* vienna
* cyberduck