Gareth Lennox

Thoughts from ScaleConf

I went to ScaleConf a couple of weeks ago, and have been meaning to write about some thoughts I had, so here it is!

The conference is, as per its name, primarily about scaling, and to be more specific, scaling software, and to be even more specific, a lot of the talks were about scaling software in your start-up.

Most of the speakers were from local companies, that are start-ups, or have recently grown past that stage. There were a couple of international speakers, notably from Facebook and AWS. They have completely different problems to the rest of us.

It was a fascinating look at building scaling systems and I found a couple of common themes kept appearing in most, if not all, of the talks. They seem to be good general practices, not just when you need your software to scale. Below are the seven common themes I identified. Continue reading →

Simple version numbers with git

Each .net project has a version number (4 dotted numbers, e.g. 1.0.0.0). While you could leave it like that, it would ideally point back a unique revision in your source control system.

Unfortunately, they need to be a number, so you cannot dump the git hash in there and be done.

There are some projects that do this for you automatically (like MSBuild Versioning), but for small projects this is typically a bit overboard.

I usually just create a windows batch file, version.bat in the root of my projects, with the following content:

SET version=0
FOR /F "tokens=1" %%a IN ('git rev-list master') DO SET /A version+=1
FOR /F "tokens=*" %%a IN ('git rev-parse HEAD') DO SET commit=%%a
echo [assembly: System.Reflection.AssemblyVersion("1.0.%version%")] > src\AssemblyVersion.cs
echo [assembly: System.Reflection.AssemblyDescription("Compiled from %commit%")] >> src\AssemblyVersion.cs

This just gets a version number from git (basically the number of commits) and the current commit’s hash and pushes it into a AssemblyVersion.cs file that I include with my project.

Yes, using the number of commits as a version number has issues if you deploy code from different places (you will get different version numbers because of merges), but remember – this is for small projects that you’d deploy from one place and that you’d typically not have a build server.

I usually have a build.bat file that first calls the version.bat one, and then calls msbuild to build the solution.

If you have a mbuild file, you could just pass in the version number and commit hash as parameters (but then, rather use MSBuild Versioning linked above).

Delivering all mail to a local account

I recently asked a question on Ask Ubuntu, regarding setting up my Ubuntu (12.04) virtual machine with a mail server, but to not actually send any mail.

What’s the point of this? Well, because I’m developing web applications that send mail, I want to test with all sorts of different e-mail addresses, other than my own, without actually sending these test messages. Ideally all the messages would get dumped into a single folder to me to review whenever I need to. Continue reading →

Using Google Web Fonts

Google Web Fonts is a great resource for custom web fonts. It is free and has a huge library of fonts (508 different fonts at time of writing).

A lot of people are saying that while the library is large, the quality of most of the fonts is not that great. While this is true, you just have to find the high-quality fonts that do exist. There are a couple of useful sites on the web that help you choose fonts out of the huge selection. Beautiful Web Type is a great resource as is Google Webfonts that Don’t Suck. Alternatively, just play around with the various fonts (there is a handy chrome plugin).

It is really easy to include whatever fonts you want in you site, just beware about having too many, as it does increase your page size as well as not looking too good if you have tons of different fonts that don’t complement each other. A good guide for choosing fonts is A Beginner’s Guide to Pairing Fonts.

I’ve recently changed what fonts this site uses, using Google Web Fonts; I went with Oswald for headings, and Lora for the body copy.