« Back to latest posts

Posts in Code

A few good html5 references

Sunday, August 15th, 2010

I started playing with html5 and wanted to share some good resources I’ve found for anyone trying to get up to speed on the specs, browser support and code samples.
For a very detailed overview of everything html5 is (and isn’t) head over to diveintohtml5.org. The section entitled “What does it all mean?” is a great [...]

Tags:
Posted in Code | No Comments »

Dividing numbers in Ruby returning zero or an integer unexpectedly?

Monday, May 3rd, 2010

There’s a “quirk” about Ruby that I often forget when going back to it after a long period of time using other languages. If you divide two integers in Ruby then it’s going to give you an integer as a result. Consider the following:

some_int = 3
another_int = 2
answer = some_int / another_int # answer [...]

Tags: ,
Posted in Code | No Comments »

Running PHP and MySQL with phpMyAdmin on OS X 10.5

Tuesday, June 23rd, 2009

Apache already comes pre-installed on OS X but PHP is not enabled by default. To enable PHP we need to edit our Apache config file by opening the Terminal and typing sudo nano /private/etc/apache2/httpd.conf and hitting enter (put in your admin password when it asks.) Type Control+W to bring up the search option and type [...]

Tags: , , ,
Posted in Code | 17 Comments »

Apache rewrite rules to force secure/non-secure pages

Sunday, March 29th, 2009

If you’re running an Apache server there’s no need to hard code your links to force https/http or write server-side code. A few simple rewrite rules will allow you to redirect your secure pages to https and your non-secure pages back to http.

Tags:
Posted in Code | 4 Comments »

Search engine friendly URLs in PHP and Apache, Take 2

Wednesday, December 3rd, 2008

A while back I posted this article about friendly URLs in PHP and Apache. Today I’d like to update that a little to not only show another method but also to enhance it a bit. When we’re done we’ll have search engine friendly URLs that look like the ones that Blogger uses.
Why? Because search engines [...]

Tags: ,
Posted in Code | No Comments »

Friendly URLs in PHP and Apache

Monday, March 17th, 2008

I’ve tried a few different ways of doing friendly URLs in PHP and all have their advantages and disadvantages. For a good introduction and some other methods that don’t necessarily require an Apache server, take a look at this sitepoint article. I’ve used Method 2 there before (.htaccess Error Pages) but I don’t [...]

Tags: ,
Posted in Code | 1 Comment »