RockPaperScissors

LizardSpock


Handle www. and no-www for better google juice

There was an interesting post on hacker news recently, safeshepherd suddenly fell off the google for their own name. The comments had some good answers especially the first by a google employee.

The gist of it is that if you have https:// and http:// and www.domain.com and domain.com google sees 4 versions of you site. It will pick one of them as the main site each time it ranks your site. This can change every, effecting the ranking, as it looks like duplicated content.

For Sinatra there is a nice bit of middle were called rack-no-www which adds the redirect for you.

Add to you gem file

gem  "rack-no-www",  "~> 0.0.2", :require => 'rack/no-www'

read more

Big Monitor Litmus Test

A recent article by sef about how to judge an engineering companies respect engineers and the strength of the engineering culture, used the size of the monitors as a litmus test. This is actually one of the things I pay attention to when getting shown around a potential new company. Do they invest in hardware that lets you work more efficiently.

I ended up moving from a company that gave me 2 17” monitors to one that supplied 2 24” monitors. Many other things were taken into consideration but it was a very good indicator of how well the engineering staff were treated.

read more

iPad 3 Tethering

Three now have tethering available for the iPad 3, which can be read in the comments by moderators on the official post.

Three have many pricing strategies available but what is the full cost over the contract term? For analysis I have assumed that pay monthly contracts would also be kept for the full 24 months.

iPad Storage Upfront Cost Monthly Cost Data per month Total Cost Comment
16GB £479 £7.50 1GB £659 upfront £20 cheaper than direct from apple
16GB £479 £15 10GB £839
16GB £159 £25 15GB £759 Save £320 upfront
16GB £99 £29 15GB £795 Save £60 extra upfront
16GB £399 £18.99 15GB £854 iPad (WiFi) + MiFi

read more

Vim Terminal Colours

I use the ir_black for vim (MacVim mainly). Recently have been doing a lot of work in the terminal over ssh and have constantly been having to switch colouscheme to dessert, just to see the text properly.

:colorscheme desert

The vimrc Which I had copied from some one else used:

" 8 Colours Modified to 16 Colors
if &term =~ "xterm"
  if has("terminfo")
    set t_Co=16

read more

Using Github behind a restrictive firewall

When working behind a restrictive firewall, which limits ssh connections you may be running into some of the following errors:

Connection refused

git clone git@github.com:morganp/maruku_snippet.git
Cloning into maruku_snippet...
ssh: connect to host github.com port 22: Connection refused
fatal: The remote end hung up unexpectedly

read more

Ubuntu, formatting a 3TB drive

I started off following the ubuntu guide for installing a new drive, which uses fdsik to create the partitions how ever after formatting and mounting I ran df -h:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       2.0T   28G  1.9T   2% /mnt/kryten/disk5

Which is not 3TB

I then found this article which worked in the long run not sure if I typo’d a command but similar to this other user I had to run through the commands a second time for them to work.

read more

Camera Apetures

The camera aperture is how far the iris is kept open during the exposure. A wide aperture, large opening lets in more light so can have a faster shutter speed but also has a lower depth of field (DOF). That is less of the image will be in sharp focus.

Lens are sold based on there largest aperture, f2.8, f4 etc but how do these relate to each other? Stops are the often used measurement of photographic equipment. Here if a lens is one stop faster it will have an aperture wide enough to half the exposure time.

From f1 the whole stops are:

1 2 3 4 5 6 7
f1.0 f1.4 f2.0 f2.8 f4.0 f5.6 f8.0

read more

Syntax error: Not a valid color stop: Sass::Script::String: white

After making a few updates to my site it stopped working after deploying. The issue was that the gem version of compass had not been tied down and the server was working with newer version.

The error was coming from this line in my sass file :

$gradient = #FFFFFF // This get converted to  'white' in the error message
background-image:         linear-gradient(to bottom, #{$gradient}, #{$back})

Again the error was:

Syntax error: Not a valid color stop: Sass::Script::String: white

read more

Minify your HTML from Sinatra

There are gzip compression options available but when I looked at this a long time ago I found that the extra server load to compress (with out caching) and the extra delay in the browser to decompress was not worth the few bytes it saved and lead to longer times before seeing the fully rendered page.

Minification or minifying is more about removing white space, in the case of javascript it can also optimise variable names. For html we would not want to do that unless our css was going to be converted to match exactly.

After a little digging and trying a few gems which failed to set there dependancies correctly and even required 'pp'*, I found TidyFFI.

  • Really useful for debugging but I do not think has a place in deployed code.

Minify HTML

read more

Joe Cornish, Book Series

Joe Cornish has been a great influence on my photography, he traditionally works with a large format field camera and is well renowned for his colour works of the british landscape. Trying to find his books in order can be tricky, so I have created this list.

  • Disclaimer : Amazon affiliate links used
First Light Scotland’s Coast The Northumberland Coast
First Light Scotlands Coast Northumberland Coast
2002 2005 2008
£16.25 £16.25 £11.04

read more