Javascript closures illustration

Jack Slocum mentioned in a comment the problem comes from the creation of a global variable. When you create a local variable, you don't get the problematic behaviour. Thanks Jack for taking the time to correct me.


Here is the illustration of a bug that was present in version 0.1 of the yui slideshow.

YUI based slideshow

As I wanted to add a slideshow on the MyOwnDB homepage, I started looking for a ready made solution, but as I didn't find exactly what I wanted, but also because I was curious of how it could be done, I started coding one based on YUI.

Remember to reset the YUI listeners on updated content

I had event listeners set on elements added dynamically to the page not working:
my original content Click here to replace content
When you click on the test_link, the content of the div is

Web 2.0 traffic watch list

MyOwnDB is progressing in Seth Godin's Web 2.0 Traffic Watch List to 595th position. Although this is not a remarkable result, and the list has to be regarded with usual caution, it's good to see MyOwnDB progress.

Mass mailing with active mailer

So, you have plenty of users, and you want to notify them of a significant update. You have all recipient emails in you database, and the corresponding ActiveRecord models. Rails also provides the nice ActiveMailer tool. Writing a script using all your existing infrastructure seems the best solution, and it's also how I wanted to send an anoucement to MyOwnDB subscribers. There are, however, two points that you need to take into account:
  • you can't simply loop over all emails, and for each address open a connection to the SMTP server.

Some tricks to use S3 in your web application

After the post on my experience, here's what I learned in using S3. I'm using the S3 library for Ruby published by Amazon.


When you save an entry with a file attached in MyOwnDB, the Rails action handling the form checks the size of the file. If it is within the limits allowed for the account, it saves the information needed locally in the database (let's say in the table "files"), and then saves the file on S3.

Famfamfam Silk icons used

I've deployed new icons in the application. These are Famfamfam Silk icons, a collection if 1000(!!) free (under the Creative Commons license) icons of really high quality, with very broad coverage. If you're looking for icons in your web application, you know where to go from now on. Note that the Silk icons are not the only ones available.

File uploads to Amazon S3 the AJAX way thanks to Dojo

File uploads are finally deployed! You can now specify in MyOwnDB that a detail of your entity is of the type "file". This will let you attach a file to an entry, and subsequently replace or delete it. This required some changes in the application, more specifically in the way the forms are submitted back to the server. For a file upload to work fine, you have to send it with the enctype attribute set to "multipart/form-data". But that's not all! You cannot just serialize the form in javascript like you can do with other input types because you cannot access the file from Javascript.

Use of Yahoo UI's tooltip and overlay

Monday has seen a big update of the signup code, with, amongst other changes, the use of the Yahoo UI libs. Although prototype is well integrated with rails, Yahoo's extensive documentation and the praise it got from some leading javascript developers got me interested, and I must say I wasn't disappointed. When you download the distribution and uncompress it, you get a directory structure.

Sending HEAD requests using Amazon's S3 Ruby lib

After some usage of Amazon's S3 storage service from Ruby, I'm quite happy with the result obtained.
Syndicate content