This is my repository of code snippets, url links, and other stuff  that I use to develop website with.  The main purpose of this site is to catalog, and easy search for the stuff that I use on a regular basis.

Character Encoding Problems with Content

November 13, 2014

I recently worked on a large wordpress blog site that had character encoding problems with the content.  It’s not that big a deal to fix one or two instances where you see funny looking characters displayed on the page, but when you have hundreds of them, it’s time to turn to mysql queries to fix […]

Disable Large Breakpoint in Bootstrap 3 for LESS

November 2, 2014

Removing the large desktop layout in less can be achieved by commenting out a few lines in the grid.less file.  Comment out these two sections in the grid.less file, and the medium grid will become the largest size for your site layout. reference: http://milos.gavrilovic.rs/how-to-disable-certain-breakpoints-in-bootstrap-3/

Using mysqldump to Backup a Database

March 24, 2014

Occasionally I have new clients that don’t have access to their control panel, so that a dump of the database cannot easily be performed from a nice GUI interface (Very useful when I want to setup their site for local development). If the server allows executing mysqldump from in php, the following code can be […]

Useful Regular Expression

March 14, 2014

This is a collection of useful regular expressions that I’ve found useful in doing some powerful manipulation of text, or extracting specific data. source source source

Keep it Secure – Enforce All Pages Over SSL

January 16, 2014

Recently I had a project that the client was using to collect user registration information, and we wanted to make sure that the information provided was done securely over SSL.  Rather than try to enforce this in the code, a simple change in the .htaccess file makes this easier to enforce.

Keep the Subscribes Off the Backend

January 14, 2014

Another quick function to help with member / subscribers sites that will keep them from even getting to the wordpress admin dashboard after logging in. I’ve modified this from the original version to check if the user used the /wp-admin/ in the url, so that you will still be able to redirect to the login […]

Hide Admin Bar For Non-Admin Users

January 14, 2014

I recently had a site where the client wanted to have the resellers register for access to specific pages, but we didn’t want those users to see the admin bar displayed on the front end of the site once they logged in using wordpress user accounts.  The following code will disable that admin bar for […]

Remove Those Extra Line Returns in Files

January 14, 2014

Occasionally when I download files for site that I work on, text files have extra returns after every line of text.  It’s annoying, and makes it much harder to work with code like this.  I recently came  across this regular expression to remove these in Dreamweaver, but it will work as well in TextWranger (or […]

Identity Crisis, moving a site to a new domain name

January 9, 2014

I recently had to move a wordpress site to a totally new domain name.  The Backup buddy plugin makes this a breeze, but google (and the other search engines) are still pointing to the old domain name.  To redirect users to the corresponding page on the new domain, and to get google to update the […]

Get All Rows For the Current Week (Sunday to Saturday)

December 1, 2013

I recently had a project where I needed to display all the rows from a mySQL database where the a date field occurred in the current week (From Sunday to Saturday).  To keep from building out a complete query in php, I went with a little less complex query all in the SQL query. Using […]

Scroll to Top