16 July 2012

It is about time I started using it

11 July 2012

So much choice. It’s hard to know where to begin.

7 June 2011

I have been playing around with Node.js and there are a few things with javascript which keep tripping me up.

27 February 2011

OK. I think I am persuaded that using Jekyll + GitHub Pages is a good idea.

17 February 2011

According to Avi Bryant (speaking in 2009), web frameworks are obsolete.

11 January 2011

I have some tables that I am populating from a CSV file and it took me a little while to work out where to unpack the contents of the file. In the end, it was obvious that the place for it was in the model. In realising this I had the epiphany (again!) that controllers should really be kept very, very simple.

22 July 2010

As David Kaneda explains in the jQTouch blog, he introduced a tap custom event to remove a 300ms delay when tapping on a link in Mobile Safari.

1 July 2010

Rails application templates allow me to automate the setup of each new Rails application, so I don’t have to repeat all the steps required to get an application running the way I want it.

23 June 2010

When adding jQTouch files to a web a page, order matters.

2 June 2010

I have a Rails-driven website which changes infrequently and contains mostly static content. It is cheaper and almost as convenient to run it as a static site than to run it as a Rails app.

26 May 2010

In any block of code, execution is sequential. Each line of code will not execute until the previous line has executed. If a line contains a function call, then the next line will begin execution after that function returns a value. If the function continues to execute code even after it returns a value, then the code in the original block is no longer executing sequentially, in other words two different blocks of code are running concurrently. Concurrency is generally achieved in software by some implementation of threads.

29 April 2010

A few notes to myself on developing on OS X 10.6 (snow leopard).

22 January 2010

I have been tinkering with MongoDB and the MongoMapper gem for Rails and creating a MongoDB-based Rails project is pretty easy.

30 November 2009

Some comparisons of ActiveRecord method calls and the equivalent SQL for associations, starting simple and progressing to joins and chained joins.

10 October 2009

You can use the .irbrc file to make changes to the Rails console. My .irbrc file currenlty looks like this:

2 October 2009

A few reminders to myself of how to keep Rails applications simple.

1 October 2009

I came across a situation where I thought I wanted to access the current_user from within a model, but it was just a case of mistaken thinking. Making session variables like current_user accessible to a model is a break with convention, and breaking with conventions is usually a bad idea. So, the rule is: don’t do it unless you have exhausted all other options. There is a probably an easier way of doing what you are trying to do.

25 September 2009

I have a tendency to multiply layouts in Rails, so that after I have defined the main application layout in /app/views/layouts.application.html.erb, I create different layouts for different controllers as needed. That’s all OK, except that I find myself cutting and pasting from the application layout which is just wrong, wrong, wrong.

23 September 2009

REST is now the standard way of doing things in Rails and I am a convert. I have always spent far too long worrying about the best way to write my applications, but now REST has come into my life and taken a whole universe of procrastination and indecision away from me.

7 July 2009

Rails offers the html_escape method (usually shortened to h), which prevents simple attempts at code injection. However, when users are entering content onto a site, there is a very good case for sanitizing the input. After all, if a rogue user is injecting unwanted code into my HTML forms, why would I want to store it in my database? It makes sense to neutralize it before it gets stored.

13 June 2009

Named scopes in rails make for tidier code.

9 June 2009

When I save data in Rails, I continually misuse the different methods available, so that my code is sprinkled with save, save!, save(false), update_attribute, update_attributes and so on. I also often introduce bugs by assigning a new value to an attribute and then forgetting to update it.

29 April 2009

This may seem trivial to some people, but I got a bit confused finding a path through the Restful Authentication plugin for Rails.

22 February 2009

Text-to-voice software and synthesised voices are getting to the point where they are really quite impressive and certainly usable. I recently discovered Acapela’s range of multilingual voices and I want to use them. However, accessing a computer’s voices from within a web page is not entirely trivial.

d. sofer