Welcome to ScratchYourself.com

Don’t wait around for a tech to scratch your back. Scratch Yourself!

ScratchYourself.com is all about web development – From Scratch! From various bug solutions and PHP tricks, to reviews and advice, to How-To Guides such as PHP/MySQL Performance Series: Part 1 – Adding Indexes, Optimize Tables.

WordPress: My Favorite Plugins

WordPress has thousands of Plugins, so many that it can be hard to find the one you are looking for – even if you know it’s name.

From an ease-of-use perspective, this is actually a bad sign. WordPress is supposed to be a customizable software package, and everybody wants to customize their site this way and that – yet even programmers have such a hard time figuring out how to do what they want, that plugins exist to either expand WordPress’s basic functionality, or to perform certain functions outright.

Ideally WordPress would be easy enough to customize that fewer plugins would be necessary, but the fact remains that WordPress sort of has it’s head up it’s own ass, and therefore plugins are necessary.

So here is a list of my favorite plugins. I’m not going to rate them most or least favorite, because that wouldn’t make any sense. Different plugins serve different purposes, and will be used for different reasons on different projects. Continue reading…

Dear Skype: WTF?

Aside from Skype joining with Microsoft to provide a variety of new-age App-related annoyances (read more here), when I finally got through those problems and logged into Skype I found another severe annoyance.

I have previously paid to use Skype to make calls to land lines. I did not realize those “credits” (aka “money”) expired after 180 days. “Thanks” to Skype, I can “re-activate” those credits to continue using the “money” that “expired”.

Yes, that’s right, money now expires. Skype makes it seem like “re-activating” credits is a good thing, even though there is no reason, whatsoever, to “de-activate” the “money” I have already paid to Skype. So here’s a shout-out to Skype for being totally stupid.

Thanks Skype!!!


Latest Windows 8 Annoyance: App Upgrades and Skype

This isn’t the first time this has happened, and it probably won’t be the last.

I like Windows, I am a long-time Windows user, a long time Windows XP lover, a big Windows 7 fan, and a big Windows 8 opponent.

Windows 8 comes with a lot of features that are late to the game. Sure Microsoft needed to add them, but they didn’t exactly think it all through.

The latest annoyance I’ve had is again App-related.
Continue reading…

Solution: How to keep your PHP sessions open as long as possible

Keeping PHP Sessions open, or any sessions open regardless of what language you use, can be a pain. One of the most commonly asked questions is “How do I keep my sessions open for 30 days or more?”.

This is written from the perspective of PHP, but of course Cookies themselves can be manipulated from whatever server-side language you use to code your web application.

So if your users only stay logged in for a few hours, maybe a a couple of days at the most, and you want them to stay logged in much longer, continue reading.

The main reason this method works is because it doesn’t rely on PHP to keep the session, and sessions on the server tend to get cleared out, which is probably the most common reason for users having to login again. Rather than rely on PHP garbage collection to work properly, you take control of a secondary session that you store yourself. When the primary login check fails (depends on your application), you check the secondary session against your own records, and if you find a match, you can auto-login the user, returning control to the PHP session itself. You can choose to be seamless about the whole process, or you can present your user with one of those unnecessary messages saying “Please wait while we find your account…”. Continue reading…

Website Owner Tips: Protect Your Domain, your GoDaddy Account and your Business

Your registrar – most likely GoDaddy – is where your purchased your Domain Name. It’s very important to keep your GoDaddy account secure, because if an unauthorized user gains access to your account, they can transfer your domain to a different owner, and it can be exceedingly difficult to regain control of your domain, so here are some tips to keep your domain and your business safe: Continue reading…

jQuery: AJAX File Uploads made easy

jQuery is an incredible Javascript library. It allows programmers, as well as other web developers with less programming experience, to develop high-end Javascript and AJAX features on their websites. Many situations require or benefit from software written from scratch, but other situations do not. For most Javascript functionality, writing your code from scratch isn’t worth it or necessary, and that’s where jQuery comes in. jQuery isn’t necessarily easy. The more customization you want, the more specific your requirements, the longer it will take you to get it right. But even if you have the time and experience, jQuery doesn’t do everything for you.

Many people are curious about how to perform a full AJAX file upload using jQuery. Some users have noted that HTML 5 supports AJAX file uploads, however most websites aren’t written in fully support HTML 5. Other users have also shown exactly how to do this using methods such as hidden iframes, and a Javascript XMLHttpRequest() object.
Continue reading…

Windows 8 apps running in the background, using memory and CPU when they are not supposed to?

Microsoft has touted their new Metro Apps as a key feature of Windows 8. Metro Apps have a bit of a mixed reputation. On one hand, they provide some much overdue features to the Windows line. On the other hand, they don’t really live up to the hype, and in many instances they are useful only because of other software shortcomings.

But Microsoft has given one claim to Windows 8 Metro Apps that, until today, I found to be true. Continue reading…

Windows 8 Metro Apps: Compensating for other problems

Windows 8 apps can be very useful, but their reputation and usefulness is mixed.

After a few months of using Windows 8, I find that one of the main reasons Windows 8 Apps are useful is because of shortcomings in other software.

For example, we want to use Windows 8 apps to play streaming music like Pandora, or to look at Facebook. But those are pretty lame reasons to develop and use a whole new App platform. I mean, those are already available in a format called “the web” and accessible using something called a “web browser.” So why do we prefer the apps over the web versions? In these cases, the Apps trump the web-based version simply because of computer resources. Having a browser open just for Pandora can drain battery and hurt performance, and the same applies for many other programs and web services. Continue reading…

jQuery: Tips for Beginners

jQuery is an incredible Javascript framework, but it can also be a bear to learn, and a bear to write even for an experienced user.

Writing Javascript and AJAX code from scratch can be extremely time consuming, and it’s important to keep inn mind that Javascript only accounts for 1/5th of your web application, maybe less, and wasting too much time on your Javascript should be avoided. In addition to Javascript, you’ve got CSS and HTML to write, as well as your server side language and DB language (ie. PHP and MySQL). That’s 5 language to manage, 5 languages to incorporate, and that’s without even considering mobile apps.

On top of that, you’ve got 4 major browsers to test your code in (IE, Firefox, Chrome, Safari), and it all becomes a bit of a blur when you’ve been working on a project for some time. Continue reading…

jQuery .load() complete callback function doesn’t work properly

jQuery’s .load() method supports an optional callback function called when the request is complete. However, you might find that the complete callback function doesn’t work properly.

The jQuery .load() documentation shows 2 optional arguments to the .load() method.

The first optional argument is “data”, which is described as “A plain object or string that is sent to the server with the request.”

The second optional argument is “complete”, which is described as “A callback function that is executed when the request completes.”.

The examples on that page present some confusion, by showing this example:

$('#result').load('ajax/test.html', function() {
alert('Load was performed.');

The problem with that example is that the “complete” callback function is shown as the 2nd argument, not the 3rd. Continue reading…