Fantastic alternative to lorem ipsum

I was introduced to a fantastic alternative to Lorem Ipsum today thanks to one of the developers I work with. Rather then use the same block text on your web sites and applications you can now use quotes from Samuel L Jackson, curtsey of Samuel L Ipsum.

Some of the more choice phrases have been taken from films like Pulp Fiction, while the more child friendly quotes are from Unbreakable. There is still an option for the classis Lorem Ipsum, but that’s not that much fun really.

I know what I’ll be using from now on when working with sample content…

Happy 3rd birthday Google Chrome

Where were you 3 years ago? Do you remember where you were when Google entered the browser wars? I was working at IPC Media and remember thinking great, another browser to support… In the end though Chrome has become my browser of choice. Even over FireFox and Opera.

Continue reading Happy 3rd birthday Google Chrome

Simple Authentication for Symfony using Facebook Login

A few days ago I set about the task of writing an authentication system for DropoutUK based around Facebook Connect / Facebook Login Button. I was pleasantly surprised to learn just how simple it seems to be these days, compared to the first implementation I played with back in 2009. Which, OK is 2 years now, but the new social plugins make life so much easier.

So what is involve? Just 4 simple actions

  1. Create a new facebook application
  2. Add your website URL to it
  3. Add the facebook Login Button to the page
  4. Check for the facebook cookie and process a login action if possible.

Continue reading Simple Authentication for Symfony using Facebook Login

Symfony2 – it’s finally ready…

Back in April we saw the first BETA release of Symfony2. Since then we’ve seen 5 beta versions, but earlier today the final version of 2.0 was released. So I’m left with the question on the back of my mind, how many companies will be upgrading their projects from 1.x? Or will they just accept that their existing projects are staying on 1.x and new ones shall be commissioned to build replacements on the new platform?

Continue reading Symfony2 – it’s finally ready…

Creating a search tool with the Searchable behaviour in Doctrine

Once you’ve set up a searchable behaviour on a doctrine model, and have indexed all the keywords on the model, you are going to want to build a search tool. First we should create a simple symfony form.

Continue reading Creating a search tool with the Searchable behaviour in Doctrine

Re-indexing a doctrine object with a symfony task

Yesterday I explained how to add the Searchable behaviour to a doctrine object,  to I’ll cover that how to create a symfony task to re-index all the existing objects. The basic idea of the task is to retrieve all the objects from your database, mark them as dirty and re-save them. If you don’t mark them as dirty, nothing will update when you save, which is what you would expect from doctrine.

Continue reading Re-indexing a doctrine object with a symfony task

Adding the Searchable behaviour to a Doctrine model in Symfony

The searchable behaviour within Doctrine is a brilliant and powerful way to add a quick and simple search to your symfony code. The basics of this behaviour are to create an index table for your given model, which contains 4 things, a keyword, the field it was in, the position and the object id it was in.

Continue reading Adding the Searchable behaviour to a Doctrine model in Symfony

Using grep, awk and sed to list files containing a string

This week I was trying to locate which files in the codebase use a specific class method while debugging some code. This method however has been used a lot, when I say a lot I mean 10 to 20 times per file, and in lots of templates. This is mainly because it is a template helper to generate complex links within the page. Anyway, a simple use of grep wasn’t all that much help, so I refreshed my memory on how to use sed to make the output a little more readable.

Continue reading Using grep, awk and sed to list files containing a string

svn diff via vim

When I’m reviewing the changes I’ve made to an svn checkout I prefer to see the changes in colour. This would be very easy if I was someone that used a graphical editor, but I’m one of those people that prefer to use vim, or vi if I really have to. As a result I had to think of a way of changing svn diff into something that was easy to read. I found out that vim has a syntax highlight template for diff files, so it got me thinking. What about pushing the diff into a file and then viewing the file in vim.
Continue reading svn diff via vim

Symfony2: Beta1 available!

It’s here, Symfony 2.0 Beta1 is now available to download and play with. You can Download Symfony 2.0 Standard Edition beta1, a good place to start is the quick tour, or the book, both of which should give you a good push in the right direction on how this new version of Symfony fits together. Continue reading Symfony2: Beta1 available!