Blog


codeigniter form validation callback

codeigniter form validation callback, when validating forms i need to check something other than just required, or a max length, or any of the default (and very good) built-in filters. i need to check a user login, so need to: define some validation rules (config below), create a callback function, and set a validation message. […]

Read more...



css gradient builder

Found a great plugin – ClassyGradient, and it’s great. really great. exactly what i was looking for, for a new project. i have extended it to allow checkboxes to choose which lines of css to output (with or without each of the proprietary prefixes). as i was integrating, i needed to update the output after […]

Read more...



php session save path permission denied

seems an update in plesk overnight (twice in the last few weeks) has cocked up the php session_save_path: no websites were able to write any sessions, so nothing added to baskets… angry customers… ahem. not sure whether i’m blaming plesk just yet, i’m investigating. but the problem in all error logs is: [code]mod_fcgid: stderr: PHP […]

Read more...



configure sendmail on mac os x

Unable to send email using PHP mail()? Learn how to configure sendmail on mac os x… Open up /etc/php.ini and set the sendmail_path: [code] sendmail_path = "/usr/sbin/sendmail -t -i" [/code] then restart apache: [code] apachectl restart [/code] if you try sendmail… [code]sendmail[/code] you will get an error: [code] sendmail: fatal: chdir /Library/Server/Mail/Data/spool: No such file […]

Read more...



firefox input button extra mystery padding

The case of firefox input button extra mystery padding. Firefox can be annoying. it seems firefox addes extra padding to button elements (or input type=”button”) that does not identify itself and cannot be removed using normal css… what? yes: this is the fix for the firefox input button extra mystery padding [code] .button::-moz-focus-inner { border:0; […]

Read more...



CodeIgniter Template the easy way

New to codeigniter template, I’m  just looking at codeigniter (one of many i’m playing with) as a potential framework to adopt, immediately found no built-in way of using a whole html document as a template (unless i’m missing something?) – are there no easy codeIgniter template options? There are loads of codeigniter template extensions and […]

Read more...



Google Analytics for Tracking Hash URLs

It’s surprisingly simple to use Google Analytics for Tracking Hash URLs really. I needed to track each “page” as it was viewed, but being a hash url driven website of course google analytics (by default) only recognises the “index”, seeing as its essentially a “one page website”. No good to anyone… So a simple one […]

Read more...



Include local file in Ruby

Yes, took me a while to find out i didn’t need “include” or “require” (coming from PHP), and so learned that all i needed was to simply use the File class and its open method… [code] f = File.open("inc/some.html"); f.read(); [/code]

Read more...



CSS System Colour Names (css system color names)

I’m building myself a new admin interface for use on my projects, and wanted to use css system color names so that I could design a more “native” looking admin area. Note: The colours are actually rather boring… So I looked up this HTML table of CSS2 System Color Names, as per http://www.w3.org/TR/css3-color/#css2-system, I know […]

Read more...