Blog


apache rewriterule: rewrite url to hash

After building a new website for a client, i needed to redirect their old URLs to new ones, normally a trivial task. But in this case the new site is driven by hash urls, so we need to rewrite url to hash url, such as: from: /apage to domain.co.uk/#!/area/section/bit and variations on that. By default […]

Read more...



search highlight in vi

  • October 22, 2012
  • vi

I was wondering how to turn off the search highlight in vi as it’s distracting when trying to code through yellow blobs of highlighting. [code]:nohlsearch[/code] and the highlighting disappears. Ideal.

Read more...



creating html snapshots for google

A recent project required that we use hash navigation for speedy access to content, this also eeded to be indexed well, and seo’d up to the eyeballs, and so i set aboutand creating html snapshots for google. After reading, becoming daunted and almost put off, i realised that its actually a very simple process indeed! […]

Read more...



google map pin not centered when using hidden embedded iframe

A bit of an issue this lately when embedding google maps iframes that are hidden by default, and are shown by the user clicking a button (for example). Seems the Google map pin not centered when using hidden embedded iframes… The pins end up not quite centered and out of the viewable area, took me […]

Read more...



HeartInternet Hostpay Error Logs Empty

Ok, so Heartinternet do some cool things, but they also do some stupidly annoying things too. Like when you are integrating hostpay, any glance at the error log will tell you nothing, because they are empty… Well. Extend shows the hostpay error logs empty. But they are not, hostpay just can’t open the log files […]

Read more...



Get URL and parse query string using Ruby

As I’ve been learning Ruby, I’ve needed to do some of the simplest things, such as getting the current URL and parsing out the query string, things that are basic in the other languages i know. I was struggling to find out how to parse query string using ruby. Such as getting the current URL […]

Read more...



show instance methods and variables in Ruby

as i am just learning Ruby (in at the deep end, the way we like it!), i needed to see what is available for certain objects (instances of) and variables methods etc, here’s what i know so far: to show methods: [code] <% puts thevar.methods.to_yaml %> [/code] and to see the instance variables: [code] <% […]

Read more...



grouping packages in hostpay

By default, it’s not obvious how to grouping packages in hostpay – packages in hostpay are stored separately, i.e if you have a “hosting package” and then set multiple subscription periods, i.e monthly, yearly etc. then the default hostpay template will output them all as individual products. We actually want to display them as packages, […]

Read more...



clever nice quotes instead of boring ones

so instead of the regular: ” and ‘ let us make some fancy curly ones: [code gutter=”false”] &#8216;/&lsquo; opening single quote &#8217;/&rsquo; closing single quote &#8220;/&ldquo; opening double quote &#8221;/&rdquo; closing double quote [/code] giving us: some ‘curly single quotes’ and some “curly double quotes” wonderful.

Read more...