Hooks are scripts that you can use to run additional code when running Git commands. They are not stored in the repository so need to be set up on each computer individually.
You can create templates for your hooks that will be used whenever you create a new repository. To do this, put your scripts into the template folders on your local machine.
On Linux:
/usr/share/git-core/templates
On Windows:
Program Files (x86)\Git\share\git-core\templates
When you next run git init you will then have these templates installed by default. Additionally, you can run git init in existing repositories to update the templates (it will not do any damage to the repo itself).
PHP has a function called nl2br that converts line breaks into <br> tags. This is really useful if you have content in a database and want to ensure the line breaks are in encoded in HTML without actually having to specify them in the content.
It is a bit of a clumsy tool though. It does not take into account that you might want to use paragraphs, or that you do not want br tags adding inside block elements such as pre or hidden elements such as script and style.
The programmers over at WordPress have done a great job of coming up with their own version that resolves all of these issues and many of us already benefit from it on our sites. Matt Mullenweg has written about it.
However, it is buried in the WordPress codebase, so if you want to use it in a non-Wordpress project, you have to mess about pulling it out of the codebase and inserting it into your own. To save myself from having to do this, I’ve created a project on Github that moves it to a standalone library. You can then drop this into your project using Composer and use away.
What a literary feast of science fiction. Isaac Asimov delivers a superb 6th instalment to his Foundation series.
This article contains spoilers.
Prelude to Foundation follows the adventures of the young Hari Seldon from when he first arrives on Trantor. He soon finds himself exploring the various different cultures and sectors of the planet.
It has a wonderful ending. At the back of my mind, there was something wrong with Chetter Hummin as a character. If he was a mere news reporter, how would he have so much power and influence? How could he go so un-noticed? Then, when he turned out to be Eto Demerzel, it all clicked into place beautifully!
If that wasn’t enough, there is then the whole extra layer of him turning out to be Daneel Olivaw as well, who we learned about in Foundation and Earth! A great ending to a great book.

So this is it then. I’m at the end of Discworld. With Sir Terry sadly gone there is no more Discworld to look forward to. There is supposed to be another novel to be published posthumously, but it is a Tiffany Aching novel, so nobody is looking forward to that.
As a way to go out though, it was good. Moist von Lipwig is a cool character and Pratchett is not afraid to introduce big changes to the Discworld universe, possibly because he knew he wouldn’t have the chance to make many more.
More importantly, who doesn’t love trains?


Hugh’s Veg Every Day! book is probably my favourite cookbook so far, so I was eager to see what River Cottage Every Day has to offer.
It’s not as good, but still useful. Mostly I think it is just a bit more hit and miss. The rabbit stew for example was rubbish. Whereas the home-cured bacon chops were pretty good and the breaded fish fillets were a winner.
The biggest challenge can often be getting the ingredients for the recipes. I haven’t dared schedule in devilled lamb hearts and oxtail stew yet in case my butcher can’t supply the foods, and the Thai seafood soup required squeezing a trip to the fish market into my lunch break.
The best part is probably the bread though. Hugh’s focaccia recipe has quickly found a regular place in our kitchen.

Earlier this month we visited Hayfield for a weekend of catching up, relaxing and enjoying the British summer, such as it is.

We have a One Pot cookbook already and it’s reasonably good. At least in theory, when I use it it has been good, though I rarely do. This book is a much larger (size wise it is A4, though not long) and similarly well presented with large photos and simple instructions with clear timings.
All of that is brilliant.
It is let down by the rest of it though. Many of the recipes just do not work very well and often they take longer than 30 minutes. They also differ from the one pot philosophy (dump everything into a pot and cook) with a variety of different cooking styles, though I’m not too fussed about this.
There are some nice recipes that I am sure we will be doing again. The meatballs worked quite well. However it look quite a quite to narrow it down to the ones that work and the ones that do not, which was a frustrating process.

Don’t get your hopes up, it isn’t 500 ways to cook a vegetarian. However, it is still pretty good. For a start, it has 500 recipes in. That is loads. Often such lists would just be identical dishes (beans with fennel, beans with onion, beans with leek), but the book does a pretty good job of providing genuinely different recipes.
Everything has a photo too. They are only small, but that is better than fewer, larger photos in my opinion. The recipes are reasonably simple and don’t take too long to make, though are not massively fancy or memorable. It’s a good every day book though.

Simon Rimmer claims he bought a vegetarian cafe and then learned how to cook. Given how successful Greens has been, you have to wonder how true that is. However, with it being a cookbook, who really cares.
The book is okay. It has some good recipes in it, most notably the sweet potato and pineapple sandwich (a main that uses pineapple for bread), Lancashire cheese sausages (that contain so much cheese they are probably less healthy than real sausages) and honeycomb ice cream.
Overall though it is let down by not having a photo of most of the recipes. The photos that do exist are large and colourful, but I dislike recipe books in which I cannot judge if what I have made looks anything like it should or not.
Isaac Asimov’s Foundation series is a masterpiece of science fiction writing. After many years it was followed up by Foundation’s Edge, which was so-so. Then, the year I was born, it was added to with Foundation and Earth, following Golan Trevize’s quest to find the planet from which all live originally came from.
It was heavy on the philosophy. Discussions of morality, ethics, whether robots are human and whether the good of the many outweighs the good of the few. This makes it slow going at the start by picks up as the book moves on.
There is a certain excitement generated on being in on the answer as it were. Obviously, being actually from Earth, and having a basic knowledge of our galaxy, you can feel the rush when you realise that Trevize is getting closer and closer.
The end is quite a nice twist too. It doesn’t throw everything on its head but provides something satisfying different. If you enjoyed the series so far, this is well worth a read.
