When creating web apps, there’s often a need to generate a random password for your users. There are a number of ways to do this, but in needing to do this recently I came up with this very simple function that will generate a password (or other random string) of whatever length you wish.
The other day I was working on a project that required me to extract a numeric ID from the current page’s URL. The problem was that the ID could either be at the end of the URL string or in the middle, depending if there were any parameters added on or not. Here is how I worked around the problem by looping through each character of the string.
I recently learned a handy little trick for tracking what companies do with your email address when you sign up for their newsletters, or enter a competition, or they find some other way to sucker you in to giving them your personal information. The only requirement for being able to do this is to have your own domain.
When I receive the final PSDs from a designer I invariably want to reach through my computer and slap him for making my life difficult. With very few exceptions, there will almost always be at least one design element that is frustratingly hard to achieve using HTML and CSS (no matter how easy the designer may think it will be). The new properties available in CSS3 have reduced this frustration thankfully, but from time to time there are problems that crop up.
When working with CSS, I have constantly encountered one particular property that is grossly misused – the
position property. If you check out the source of almost any website you will see plenty of elements with randomly defined position properties. I just thought I’d clear up some of the confusion, as understanding this property will make your life significantly easier when creating layouts.