Find all symbolic links with the find command

This quick tip shows how to find all the symbolic links under a particular directory using the “find” command from the command line on UNIX based systems such as Linux, OSX and BSD. Find all symbolic links Substitute [path] in the example below with the root level path you want to find symlinks from, and …

Read more

OSX Quick Tip: How to remove automator services

The Automator in OSX allows you to create processes, services, folder actions etc. Once you have created a service in Automator there doesn’t appear to be a way to delete it in the Automater app.

Delete an Automator Service

To delete an automator service, open up the finder and navigate your way to you own Library then Services folder. The files are there with the name you gave it in automater. If the file extension is visible it will be “.workflow”.

So for example, if you created a service to hide dot files and had called it “Hide dot files” then it would show as “Hide dot files.workflow”.

Categories PHP

Netbeans Quick Tip: How to use tabs not spaces

If you are like me and you prefer to have tabs and not spaces for code indentation and are using Netbeans, it uses spaces by default. This quick little post shows how to use tabs instead.

Use tabs not spaces for code indentation in Netbeans

Go to Netbeans -> Preferences -> Editor -> Formatting on aMac
or Tools -> Options -> Editor -> Formattingon Windows

Uncheck the box that says “Expand tabs to spaces”

If you don’t like the default 8 spaces for a tab then change the “Number of spaces per indent” option as well to a more sensible number like 4.

Click “OK” and you are done.

PHP Quick Tip: use __DIR__ instead of dirname(__FILE__) from PHP 5.3

The traditional way of getting the directory the current file is in with PHP is to use dirname(__FILE__). From PHP 5.3 there is a new magic constant__DIR__ which is the equivilent of this function call.

__DIR__ magic constant

The __DIR__ magic constant is a “magic constant” which changes depending where it is used. It contains the directory of the file it is in. If the file is an include, it is the directory that include file is in. If it is the main script it is the directory that script is in.

__DIR__ is available from PHP 5.3 only. If prior versions a notice will be issued if it is used and the value will be __DIR__ and not the actual directory.

Example error if a version prior to PHP 5.3 is used:

Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in ...

Unless your application requires the use of PHP 5.3 or greater, stick with the traditional use of:

dirname(__FILE__);
Categories PHP

Web Developer Form Filler plugin for Google Chrome

I need to test web forms a fair bit, and there’s also a particular online registration website that I can’t get all the information I need until I’ve submitted an initial form, and got tired of always filling these forms in. So enter the search for a decent automated form filler plugin for Google Chrome.