Fork me on GitHub

Tag: php

Tag Archives: php

A few PHP Dev Helper functions

I’ve come to be pretty reliant on a few little dev helper functions that I’ve written that help introspect data in a couple of different output methods. A lot of development, especially development with unfamiliar systems, involves looking at objects and their contents. These helpers are designed to help give consistently formatted output no matter […]

September 27, 2011 | Web Design & Development | 2 comments

WordPress TextMate bundle updated for WordPress 3.2

So, WordPress 3.2 has been out for a little while now and I’ve just gotten around to updating the bundle. My apologies, I’ve just been super swamped with a new job in a new city. But that’s some whining for another post. After much fiddling, the updated WordPress TextMate Bundle is here and it has […]

July 11, 2011 | PHP Scripting, TextMate, WordPress | 1 comment

Beware MAMP’s default Caching Settings

MAMP is a wonderful thing. It allows for quick setup of a LAMP stack just about anywhere. This makes it great for testing. However, the folks who manage MAMP are focusing MAMP’s default settings towards production use, not development use. This means that XCache is turned on by default and that means that there is […]

March 14, 2011 | Computers, Web Design & Development | 3 comments

A simple way to limit file downloads to only logged in users in WordPress

So, you’ve used WordPress to build your client’s site and to provide downloads for the site’s users. You’re hiding the links to download content based on the user’s logged in status. Great. But what happens when the logged in user copies the download URL and sends it to his friend? Well, unless you’re filtering the […]

July 1, 2010 | Web Design & Development, WordPress | 40 comments

Everything I know about optimizing a WordPress install

I don’t mean to badmouth WordPress when I say this, but if you deploy a WordPress based site without optimizing your install you’re just asking for a slow site. Below is everything I know about optimizing a WordPress installation. It is by no means a list of everything you can do to optimize a server […]

March 31, 2010 | Web Design & Development | 7 comments

Flickr Image URLs to BBCode in OS X 10.6 and Automator

I guess its just kinda worked out that the forums that I participate in all deal with BBCode and their text formatting. S’okay – I’ve been doing one thing or another in BBCode since, well, BBCode came out. At one point I even wrote my own expanded parser. But the time involved in posting flickr […]

September 12, 2009 | Computers | Comments Off on Flickr Image URLs to BBCode in OS X 10.6 and Automator

WordPress Post Password Token plugin

This post is to introduce the WordPress Post Password plugin. This is a plugin designed to allow users to access password protected content without having to enter the password. This plugin was built based on an idea from, and in cooperation with, Gordon Brander. The concept is simple: when a post is given a password […]

September 8, 2009 | Plugins | Comments Off on WordPress Post Password Token plugin

Quickly unserialize PHP array data in TextMate

Every once in a while I need to see what’s hiding in a serialized array in a database field and finally just wrote a little TextMate command to do the job for me. If I’m already working in that area of code its easier to just dump it someone in the page output to read […]

August 28, 2009 | PHP Scripting | 3 comments

MacPorts, php5-mysql & mysqlnd

If you don’t know what that title says, don’t bother reading on 😉 A little useless history: MacPorts decided to use the recent release of PHP 5.3 to change the way they handle PHP5 Extensions. They used to be applied by the MacPorts variants system but have been changed (and appear to still be in […]

August 26, 2009 | PHP Scripting | 4 comments

Use array_merge to reorder arrays

This one is pretty fun. Well, at least I think it is. I was working with jQuery UI Sortables the other day and getting the reordered elements from jQuery back in to PHP for reordering via Ajax I ended up with an array whose elements matched the array keys of the array that I needed […]

August 21, 2009 | PHP Scripting | 1 comment

Sort arrays by key revisited

I don’t know why but I have an infatuation with little utility functions. Its pretty stupid, but it keeps me entertained and provides me with a cheap blog post 😉 That and I’ve noticed it trending A LOT in my search keywords lately, so I figure I should post some updated and easier to use […]

July 29, 2009 | PHP Scripting | Comments Off on Sort arrays by key revisited

Announcing the SP Source Code Highlighter plugin for WordPress

Maybe you noticed already, maybe you didn’t (I’ll wager on the latter 😉 ) that recently this site got new source code highlighting in posts. Or, should I say, that it GOT source code highlighting in posts. I had made a simple Script Source viewer a while back. Something simple and straight forward that I […]

July 7, 2009 | Code, PHP Scripting, Plugins | 1 comment

Quickly validate PHP files

Ever needed to quickly scan a directory full of PHP files for syntax errors? You can do this quickly on a *nix command line with: find . -type f -name \*.php -exec php -l {} \;

June 26, 2009 | Computers, PHP Scripting | 3 comments

Lipsum Plugin for WordPress, Version 2

After a while of using and not using this plugin I decided that it needed an update. The previous version would simply insert paragraphs of lipsum but now the plugin is set up to return a few helpful elements as well.

February 22, 2009 | Plugins, Web Design & Development | Comments Off on Lipsum Plugin for WordPress, Version 2

Stupid ASCII Addition Answer Page

So, I found a neat little math trick this morning that would build numbers out of ascii characters, so I modded it to respond to user content. Sound riveting and useless? Ya, well, it is. But it kept me entertained making it. The Stupid ASCII Addition Answer Page. Update: 2009-02-20 And then there’s the analytics… […]

February 17, 2009 | PHP Scripting | Comments Off on Stupid ASCII Addition Answer Page updated has received its long overdue redesign. The update also puts the site on WordPress. The site is about the writing so the design is meant to be playful and stylish, yet still leave the content as the main focus. There’s still plenty of work to be done but this gets it off the ground […]

September 2, 2008 | Web Design & Development | Comments Off on updated


Yep. Work has been time consuming. I’ve been reading more (currently reading up "World War Z"). I’ve been focusing more on photography and boning up on my lighting skills. Been programming plenty, just all at work. Life is good, but this poor, poor, excuse for a blog is dying a horrible death. He didn’t totally […]

April 23, 2008 | Life | 1 comment

File upload class – it is fixed!

After a long time of knowing there was an issue with the script I finally got around to checking it out. Its a little embarrassing to say, but, here’s the dish: I wrote all the functionality to check the file type, but forgot to actually implement it… oops. The file is correct now, so to […]

August 30, 2007 | PHP Scripting | Comments Off on File upload class – it is fixed!

Case Insensitivity and a bite in the ass

I made a disturbing discovery lately and I can’t believe that it has taken me this long to run across it. Case insensitivity in OS X can play havoc with a website, like completely bring it down, if any capitalization errors are made and not caught before moving to a case-sensitive server, like a unix […]

March 16, 2007 | PHP Scripting | 4 comments

Classes for file uploading in PHP

Surprisingly, I still get a lot of referrals from The Stickman for his work on a multi-file javascript upload helper on which I briefly assisted on Safari compatibility. The script adds and removes file upload form elements as requested by the user. So a form can be designed to handle as many uploads as you’d […]

December 22, 2006 | PHP Scripting | 45 comments

Convert file size denominations in PHP

Convert a file size from one measure to another. For example, take a file that is recorded as 512KB and have it converted to .5MB. Yeah, that’s an easy example, but that’s ’cause I was writing it off the top of my head. So, if you need this sort of thing, here’s a function that […]

December 20, 2006 | PHP Scripting | Comments Off on Convert file size denominations in PHP

5.2 or not 5.2, that is the question…

I so badly want to start using some of the new features in PHP 5.2 but don’t want to get too far into it before our web host at work makes the switch. After all, they’re still on PHP 5.1.1. With so many neat additions to the language its hard to resist, but I don’t […]

December 6, 2006 | PHP Scripting | Comments Off on 5.2 or not 5.2, that is the question…

Show PHP source without duplicating files

Every once in a while I want to show a php script’s source code. I would always have a .php file to show an active file in use and a companion .phps file (php-source) to show the source. With a little mod_rewrite and php this can be done with just the one active file, and […]

November 22, 2006 | PHP Scripting | Comments Off on Show PHP source without duplicating files

PHP: Sort Multidimensional arrays by key

Update 2009-07-29: This code has been updated and posted here: Sort Arrays by Key Revisited. So, I had to do some array sorting this week and finally bit the bullet and wrote a class to handle it. If you’ve got the need to sort a multidimensional array by a sub-array key then this might be […]

November 8, 2006 | PHP Scripting | Comments Off on PHP: Sort Multidimensional arrays by key

Setting the base directory in PHP

Knowing the base directory that you’re working from when building a site is a pretty basic need. For the longest time I had been content with just manually setting the base paths and switching between them based on the name of the server. I recently learned a much better way. I hadn’t really sought this […]

September 30, 2006 | Web Design & Development | 6 comments