Archive for the ‘development (web)’ Category

Three Key Things To Look For In A Web Developer

With thousands of businesses promoting web design and development services, it can be hard to know what to look for. Other than the obvious method of looking at their previous work and deciding if you like their design style, there are many other important factors you should consider. Here is a short list of […]

Using Xampp on Mac for Ruby on Rails

I recently installed Xampp on my mac to help with some other development work, only to find that my previous install of MySQL which I was using for Ruby on Rails development no longer worked. I was receiving errors:

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’

and

No such file or directory - /tmp/mysql.sock

To fix the problem, I added the following line to config/database.yml

socket: /Applications/xampp/xamppfiles/var/mysql/mysql.sock

Huge thanks to http://soledadpenades.com/ who had the solution.

Chmod MODx MaxiGallery fix

MaxiGallery is a customizable image gallery for the PHP application framework/CMS MODx. I have been testing it out locally on a windows based PC running Apache, and came across an error when trying to upload files as per the Picture and Thumbnails walkthrough. [Read the full post…]

Ruby: Displaying current date/time as default in text field

This is pretty basic stuff, but I couldn’t easily find the details on how to do it, so here it is for anyone else who is looking for it.

Scenario: I wanted to put the current date and time as the default text for the date field in a form.

The code:

In the form I used:

<p> Date: <br /> <%= f.text_field :date, :value => @current_time %> </p>

And in the controller for the view put:

@current_time = Time.now.strftime(”%Y-%m-%d %H:%M”)

Formatting:

You can change the formatting of the date/time displayed, but I am using this for now as this way it puts it straight into MySQL without me having to rework it.

Additional info:

Refer to: http://au2.php.net/strftime for details on formatting dates using strftime

Bring on the gravatars

Today I have updated this site with Gravatar so that all you nice folks that leave me comments (you know who you are) can now also include an avatar. Gravatar ( Gloabally Recognized Avatar ) allows you to store an 80 x 80 pixel image on their servers. They even have a nice tool to help you crop your image. Then each time you leave a comment on a gravatar enabled site, it will automatically add your avatar, based on your email address.

Sounds nice, where do i sign up?
To signup, just go to http://site.gravatar.com/signup pop in your email address, upload a picture, and you are ready to go.

Run your own blog and want to add gravatars?
The good team at gravatar have created plugins for most of the popular blogging engines, so just head over to http://site.gravatar.com/site/implement and download the plugin for your site.