PHP COVID-19 Coronavirus Data via JSON

Want to add Coronavirus data to your website? It’s simple with PHP and JSON. There are numerous resources available to pull data from. For this example I will utilize the COVID Tracking Project API. API Data Visit the COVID Tracking Projects API page and find your State from the “States …

Adding Dark Mode to Your Website With CSS and jQuery

Dark mode is all the rage these days. With Apple adding Dark Mode to the upcoming iOS (13) I see this trend increasing in its popularity. The current Mac OS (Mojave) and current Windows OS (10) support Dark Mode themes. Several web browsers are supporting Dark Mode detection when using …

Convert Image for Web With Automator Workflow Using ImageMagic

I have a website where I always upload image files with a standard image size, quality level and unsharp. Instead of loading Photoshop or another image editor I wrote a simple Automator workflow to convert the file with my specified parameters using ImageMagic. Requirements: Automator, ImageMagic Workflow Breakdown Ask for …

PHP Form Select with Date Range

Create a form select with a range of years automatically with PHP. [php] &lt;select&gt; &lt;?php foreach(range(2008, (int)date("Y")) as $year) { echo "\t&lt;option value=’".$year."’&gt;".$year."&lt;/option&gt;\n"; } ?&gt; &lt;/select&gt; [/php] The above code will output the following: <select> <option value=’2008′>2008</option> <option value=’2009′>2009</option> <option value=’2010′>2010</option> <option value=’2011′>2011</option> <option value=’2012′>2012</option> <option value=’2013′>2013</option> <option value=’2014′>2014</option> <option …

Load jQuery from CDN with Local Fallback

It’s best to load jQuery from a reliable CDN (like Google) for your code. Sometimes (rarely) the CDN you are pulling from may be down or possibly blocked by your web provider. You can add local link to insure your scripts properly function. Simple!

Create RSS Feed From Facebook Page

I use RSS feeds frequently for my work. Some companies and organizations have turned to their Facebook Pages for posting current news and have abandoned traditional RSS. I have found a nice way to create RSS feeds for those Facebook Pages so I don’t have to be on Facebook all day …

Awesome Visual Crontab Editor

I don’t regularly create cronjobs; however when I do I can never remember the proper crontab syntax. Each time I want to edit my crontab I have to fire up my codebox for reference. For some reason its the minutes and hours that screw me every time. The trusty old …

Populate a DIV from a Form Select with jQuery

Have you ever wanted to populate a div with some specified text based on a form select. Below is my super simple solution. First you will need to add a select into your form and create the div where you want your specified text displayed. The HTML [html] <select name="mySelect" …

Free jQuery UI Themes Collection

jQuery UI, the official user interface components library of jQuery, offers a lot for quickly implementing widely-used widgets and features into websites. It consists of the popular datepicker, slider, accordion, progress bar, drag ‘n’ drop and much more. And, it is themable, there is even ThemeRoller which allows anyone to customize …

Stop SOPA/PIPA (PROTECT-IP)

Congress is about to pass internet censorship, even though the vast majority of Americans are opposed. We need to kill the bill – PIPA in the Senate and SOPA in the House – to protect our rights to free speech, privacy, and prosperity. YES – These bills WILL affect how …

Automatically Update Your Copyright Notice Date

Every year some lonely web folks are wasting time updating the copyright dates on their various websites footers. Since we have jumped head first into 2012 lets start the year off right. The following will show you how to use PHP to automatically update your notice. Display Current Year [php] …

Business Days To/Fro with PHP

The below example will help you with finding or setting a date to and/or fro using business days only. I needed this for a project I was working on and thought I would share. [php] <?php function dateFromBusinessDays($days, $dateTime=null) { $dateTime = is_null($dateTime) ? time() : $dateTime; $_day = 0; …

Super Simple Page Cache with PHP

Here is a super simple way serve up a cached version of your HTML. [php] <?php // define the path and name of cached file $cachefile = ‘cached-files/’.date(‘M-d-Y’).’.php’; // define how long we want to keep the file in seconds. I set mine to 5 hours. $cachetime = 18000; // …

PHP Snippets – The Name Says it All

I’ve been following a new website via Twitter. PHP Snippets (www.phpsnippets.info) posts frequent useful PHP code samples. PHP Snippets is maintained by Jean-Baptiste Jung, author of Cats Who Code and WPRecipes. PHP Snippets is a great place to find clean code samples to get you started on your project. I …

Domain Names Gone Wrong!

The below domains are registered to legitimate companies, who didn’t spend quite enough time considering how their online name might appear! ‘Who Represents’ is where you can find the name of the agent that represents any celebrity. Their Web site is: www.whorepresents.com ‘Experts Exchange’ is a knowledge base where programmers …

Dropbox Tips & Tricks – My Top 5

I love Dropbox; it’s simply amazing and über helpful. Appstorm has published several posts with some really useful Dropbox tips. Below are the five tips and ticks I can’t live without. Tips & Tricks If you’re not familiar with Dropbox, let me first start out by saying you’ve been missing …