Smiffy’s Random Tech Tips


(Listen carefully, I shall say this only once!)

Every now and then I feel a need to communicate various little technical tips that stem from my work or stuff that I observe on the web.  They rarely get written up because they tend to be too short to justify an article on Smiffy’s Place and, now that I am using Twitter, too long to fit into a silly 140 character limit, even when written in Newspeak and with ridiculous abbreviations.

Today I decided to start making collections of these as draft articles, publishing those articles when I felt that I had enough to make it worth anyone’s while to read them.

The number of tips per article is something on which I am, as yet, undecided.  Somewhere between 3 and 10 sounds sensible to me, so I may well just stick at that.

The First Tips

(X)HTML authoring – the Joy of Comments

Add comments to the end of block-level elements with IDs so that you can see what you are closing and pick up any orphaned </div>s, etcetera, that are stopping your code from validating.  (This can also apply to classed elements.)

This can also help other people working on the same project keep track of what you are doing, say you are writing backend code and someone else is doing the styling.  (Documenting your IDs and classes can save others on the project much frustration and puzzlement.)

Unless you have a specific reason to retain them, comments may be removed easily using regular expressions or other pattern patching. Note that superfluous comments can contribute to the overall weight of a page and thus slow down your site for visitors and also eat into your bandwidth.

Hardware repairs, modifications – Use a Camera

Where hardware can be anything from laptops to washing machines to cars to X-Wing Fighters.

In addition to the tools that you would use regularly, have a digital camera on hand and photograph every stage of disassembly, especially if you do not have a manual.

I recently had cause to disassemble our wheelbarrow so that it could be stripped of its defective powdercoat and painted.  There was a gap of a couple of months between the disassembly and the painting/reassembly.  Without the photographs that I took, I would probably have a very strange-looking wheelbarrow now.

The “use a camera” tip can also extend to excavations.  If you are building or renovating a house (shed, office, bat cave, whatever,) photograph all trenches where pipes and cables run, from several angles.  This can be very helpful in the event of any future excavations, fencing work, etcetera.

Don’t forget to file your images where you can find them again (tagging with Picasa can be useful,) and make sure that they are backed up.

Pressure pumps – the Peril of Snails

This one’s a bit obscure – mainly applies to rural Australia.

If you have an outside electric pump on rainwater (or other) service which has not been run for a while, remove the fan cowl (with power disconnected!) before operation to check for infestation of white snails.  These may or may not cause the pump to jam, but should be removed anyway.  Also check that the pump is primed and any inlet valves are on before starting.  And put the fan cowl back.

JavaScript – JSLint

If you are working with large chunks of JavaScript (ECMAScript,) you may wish to consider validation using JSLint.  You may also wish to consider checking that you are using good programming practices: always declare your variables, comment your code, don’t try coding when you are too drunk, etcetera.


There you go, just a little taster.  More will follow, sometime.

TinyURL for this article: