UPDATE your_table SET your_field = REPLACE(your_field, ‘articles/updates/’, ‘articles/news/’) WHERE your_field LIKE ‘%articles/updates/%’
Categories
Tags
UPDATE your_table SET your_field = REPLACE(your_field, ‘articles/updates/’, ‘articles/news/’) WHERE your_field LIKE ‘%articles/updates/%’
Css pre-processors are great. Variables alone make it great, but there is so much more to it. Here’s my notes: Getting it working for development On a Mac OSX 10.13 For scss/sass, install Compass Once you have a project with sass files, let’s say inside ~/Code/example.com/template for example, you’ll need to make sure there’s a […]
When the music died After one particular iTunes upgrade, all of my music disappeared. Deleted from the drive they were stored on. It’s OK because I got it back but it was a process, and in the spirit of not getting hosed again, I’m writing down what I did and what I’m now doing to […]
This handy script will backup a directory and database. To use, create a new file on your server, probably in your user’s root, called backup.sh and add the below, making sure to update the source and destination path varaibles and database name. To run the script, do this:
The below two statements are equivalent. The first uses the ternary syntax and the second uses the more traditional verbose syntax. The condition should be a statement or variable that evaluates to true or false. true will be executed if the condition is met. false is executed if the condition fails. You could argue that […]
Whenever I’m adding a new feature and I start poking around, the goal is always to get something working and turned around in a hurry. Unfortunately, a lot of my code does not start out with adaptablitiy and extensibility in mind, so this rarely happens. Instead of doing things right the first time, I’m usually […]
Here’s some handy functions for calculating the median or average of an array of numbers. The median is the number in the middle of an array of numbers, or when the number of items in the array is even, the median is the average of the two numbers that straddle the middle. The below was […]
When issuing commands from a shell, the system will check for programs in the directories listed in your $PATH variable. Multiple paths are the norm, and each should be divided with a colon. Earlier directories will be searched before whatever follows. Here’s an example $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin To see what’s currently in your $PATH variable Adding […]