January 5, 2012
Here is one method of how to integrate a Ruby on Rails application and a PHP application or even just static HTML using Apache webserver. One reason for doing this could be (in this website’s case) that your main website application is Rails but you want to use WordPress or… [...]
December 21, 2011
Here is how I have been creating dynamic page titles, page descriptions, etc (anything you want really) using Rails. In app_root/app/helpers/application_helper.rb create the following method # Format and return a title on a per-page basis def display_title base_title = “mysite.com” if @title.nil? base_title else “#{@title} – #{base_title}” end end… [...]
December 19, 2011
< 17 December 2011: This website, robertomurray.co.uk was PHP and running (slowly) on a shared hosting server. > 17 December 2011 The website is now on a new server and the site is mainly Ruby on Rails Switchover OK, here there are two major changes; 1) Migrating to new server… [...]
November 5, 2011
Postgresql has the inet and cidr datatypes and some great functions for these types, very useful for storing and manipulating data for IP addresses and networks. As a basic example, say you were storing hostnames and IP addresses, basic example table below: id ip_address hostname 1 10.10.100.15 server01 If I… [...]
November 5, 2011
Is this the easiest way to find the maximum count value of a list of integers? I have a list of integers and need to find the maximum count of how often they each occur – so loop through the list, adding to a hashmap the value and the count,… [...]
November 3, 2011
For some reason the ActiveAdmin gem, a great administration framework for rails apps, has its own CSS files loaded for ALL other views (only trying in dev env). Quite annoying and will over-ride your styles. To fix I have just moved the app/assets/stylesheets/active_admin.css.scss to vendor/assets/stylesheets/active_admin.css.scss – It is only loaded… [...]
June 27, 2011
I read a very interesting post from one of the founders of github.com who had heard a great metaphor for Agile development; Imagine you’re tasked with building a computer controlled gun that can accurately hit a target about 50 meters distant. That is the only requirement. One way to do… [...]
June 17, 2011
Here is proof as to why you should add a slash ( / ) to the end of a URL to speed up your site, nothing new here, its common knowledge but doesn’t appear to be implemented too commonly. Let me expand a bit, when you visit a website in… [...]
May 17, 2011
I recently took my first steps as a freelance web developer; actually these were less steps but rather poking a foot in to test the water. I found it neither too hot to handle, nor too cold for comfort (luke warm I suppose you call it) but all the same… [...]
April 15, 2011
PHP has the function string strval($var) to return a string value from the variable which is great but the string value of a boolean is either 1 or 0 so this will not return the string “true” or “false”. This simple little example and function shows this and is great… [...]