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
Categories
Tags
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
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 […]
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 […]
Grab a webpage and display it:
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 […]
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.
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. […]
Backing up Restoring a backup