Multi-Dimensional Array/Object Sort

I can never remember exactly how to accomplish this yet I need it all the time. This makes use of usort and a custom comparison function

Combine commits with Rebase – squashed!

If you commit often while deep inside a coding tornado, that’s great, but you should clean up after the whirlwind so that your commits tell a better story. Use an interactive rebase to combine multiple smaller incremental commits into larger ones. This helps swab out the dumb “forgot something” or “code cleanup” commits, and enables […]

Git prune remote and local branches

Simple Date Countdown

MySQL command line cheat sheet

Selecting a database Listing databases Listing tables in a db Describing the format of a table Creating a database Creating a table Inserting one row at a time Retrieving information (general) Fixing all records with a certain value Retrieving unique output records Sorting Date calculations MONTH(some_date) extracts the month value and DAYOFMONTH() extracts day. Pattern […]

Simple PHP cURL example

Grab a webpage and display it:

Symbolic Links

Symbolic links come in real handy when you need to create multiple paths to the same directory. Why would you need to do this? Dependencies are one great reason. Let’s say you install a new package that needs to be configured to point to another library, and let’s suppose that library gets updated, and let’s […]

Reset all user passwords in Joomla!

I found myself needing this script for some nonsense reason involving tech-averse users an an intranet. I decided to document it below for posterity. It’s real dirty, so use at your own risk.

Change the default Joomla! database table prefix

Don’t be a sucker. The easiest way to give a hacker a head start on your Joomla installation is to use the default table prefix for your database. In the 1.5 days, the installation process always defaulted to “jos_”, but nowadays, I think they’ve eliminated this security risk by generating a unique prefix for you. […]

MySQL backup and restore

Backing up Restoring a backup