Archive for the ‘Snippets’ Category

Format Social Security Number

Tuesday, September 29th, 2015

Takes a string of numbers and formats it into a Social Security number format. Example: formatSSN('123456789'); //returns "123-45-6789"

Tags: ,
Posted in Snippets | Comments Off on Format Social Security Number

Force a number between 2 numbers

Tuesday, September 29th, 2015

Forces a number between two numbers, this helps avoid if lots of statements.

Tags: ,
Posted in Snippets | Comments Off on Force a number between 2 numbers

Generate Breadcrumbs

Tuesday, September 29th, 2015

This simple function allows you to automatically generate breadcrumbs! Notice that it is important to follow the example given as a comment I mean: - array(URL, TEXT, BOOLEAN) : "TRUE" makes the link active

Tags: ,
Posted in Snippets | Comments Off on Generate Breadcrumbs

Generate Selection List of State Options

Tuesday, September 29th, 2015

This will generate a selection list of options for states. Pass the state that should be selected to the function and it will set that state as selected.

Tags: ,
Posted in Snippets | Comments Off on Generate Selection List of State Options

Cleaner Function to Generate Select Option List for Countries

Tuesday, September 29th, 2015

This is I think a cleaner way to handle generating a list of selection options. The only thing that needs to be done to add or remove a country is to modify the countries array.

Tags: ,
Posted in Snippets | Comments Off on Cleaner Function to Generate Select Option List for Countries

Email Script Errors

Tuesday, September 29th, 2015

Send emails to your email to debug scripts that you can't see the errors for. This helps for scripts such as background scripts, API scripts, asynchronous scripts and so on.

Tags: ,
Posted in Snippets | Comments Off on Email Script Errors

ROT 5 Caesar Ciphers (Number Only)

Tuesday, September 29th, 2015

ROT5 covers the numbers 0-9

Tags: ,
Posted in Snippets | Comments Off on ROT 5 Caesar Ciphers (Number Only)

i-Ticketz Artist XML feed

Tuesday, September 29th, 2015

Code snippet of how to get artist info out of the http://www.i-tickets/Feed/ArtistRss?name=

Tags: ,
Posted in Snippets | Comments Off on i-Ticketz Artist XML feed

Simple PHP pre-installation checklist script

Tuesday, September 29th, 2015

I am currently working on my own content management system and decided I would release a little pre-installation checklist script that makes sure you have all the required functions enabled on your hosting environment and shows you what you currently have and what is required in the end. If you have all the requirements that the script requires, it shows a little button at the bottom to continue the installation, if not, an error. You can easily change the file you want to check writing to by editing $file It comes with some styling already and in a nice table. Enjoy and let me know how it is.

Tags: ,
Posted in Snippets | Comments Off on Simple PHP pre-installation checklist script

Fix the annoying WordPress 4+ Chrome bug

Tuesday, September 29th, 2015

The WordPress 4+ admin screens render badly in Chrome 44+, it's a Chrome bug which is being tracked but here's a little snippet to fix it in the short-term. Simply add this snippet to your functions.php file.

Tags: ,
Posted in Snippets | Comments Off on Fix the annoying WordPress 4+ Chrome bug