John Squibb
PHP Security Tips
Security is one of the most important aspects of any web application, and there are lot of steps you can take to spruce up your code to make it more secure. This week, we'll address some basic security pitfalls and go over some strategies that anyone can employ. Make your application more secure, trustworthy, and resistent to hackery! [Read Full Article]
Introducing PHP Appliances
My goal, was simply to create some PHP objects, based on real-world household appliances, that rely on their own tightly knit set of interfaces, classes, and helpers. [Read Full Article]
Mr. Singleton, a Singleton for all Singletons
If you are familiar with the [Singleton] pattern, and like me, have grown tired of adding getInstance() to all your classes and privatizing their constructors, then say hello to the Singleton class, known among his inner circle, as Mr. Singleton. [Read Full Article]
Overcoming Magic Numbers Through the Use of Constants
Magic Numbers are unnamed numerical constants that appear directly in code, inhibiting the reader from immediately understanding the intended purpose of the value. They litter the best of code, and often creep in with quick modifications, one-offs, tweaks, and so forth. The good news is, Reducing them can be as easy as adding a few extra variable declartions. For developers using Object-Oriented PHP, class constants can provide a quick and easy escape from the evil, universe-imploding doominess of Magic Numbers. [Read Full Article]
Bash Image Resize with Image Magick
Whenever I have to put travel photos up on the website, or send a bunch to family and friends, I find that the downloaded size from the digital camera is a bit much for general use. I rarely need my photos in the 3648x2736 resolution that my 10MP camera stores to the memory card. There a lot of GUI utilities out there for Windows/Mac/Linux that will import, resize, crop, and do a gazillion other things with downloaded photos, but generally, I just need a quick batch resize on a folder full of pics. Enter Bash and it's trusty sidekick, the Image Magick convert utility. [Read Full Article]
Fun with PHP 5.3
Version 5.3 has been out a little over two months, so it's nigh time I dug into into it! It's surprising that I've waited this long to get around to installing it, as it contains some tidbits that I have been eagerly awaiting since talk about PHP 6 began a couple years ago. In addition to the usual bug fixes, this version includes support for two features of particular interest to me: namespaces and variable static method calls. [Read Full Article]
Google Linux Search
As an everyday Linux user and programmer, I am constantly on the prowl for articles, new shiny applications, forums, distro updates, and the like. Most of all, like any regular computer user, I am always trying to streamline my processes. I've got iGoogle, complete with my favorite Linux and programming widgets and a fancy planet theme. I've got the Google Toolbar. I've got Google set as the default search provider in all my browsers. I'm all Googled-up, yet I still yearn for more Google customization. Enter Google Special Search. [Read Full Article]
Suggested Reading
PHP Design Patterns
by Aaron Saray
Seasoned programmers looking for a good book on PHP design patterns will thoroughly enjoy PHP Design Patterns.
Weighing in under 250 pages of readable content, it presents a truckload of philosophy and pattern samples in a well-condensed format, with short, consistent chapters.
The title starts off with a quick explanation of patterns, champions their usage, and by chapter 3, the user is thrust right into the Adapter Pattern.
For the next seventeen chapters, the user is given a synopsis, a problem/solution summary, a UML diagram, and code examples for each of the patterns in the discussed in the book.
Generally, the code provides a typical approach, and then a modified approach using the chapter's pattern.
Tags: Bash,image,resize,imagemagick,php 5.3,google linux search,class constants, magic numbers
Short URL: http://sqb.in/C2tg