Skip to content

Instantly share code, notes, and snippets.

View gabeshaughnessy's full-sized avatar

Gabe Shaughnessy gabeshaughnessy

View GitHub Profile
@gabeshaughnessy
gabeshaughnessy / index.php
Created June 23, 2020 19:30
Example Date Time Formatting
<?php
//Creates a formated string from a start and end date DateTime, a start and end time DateTime, and optional DateTimeZone.
function formatDateRange($d1, $d2, $t1, $t2, $tz=false) {
if(gettype($t1) === 'object' && gettype($t2) === 'object'){
$formatted_time = "";
if($tz && preg_match('/(\-|\+)[0-9]*/', $tz->getName() )){
//use 24 hour time for EMEA
$hour_format = 'G';
<html>
<head>
<title>
Text Particles
</title>
<meta property="og:title" content="Text Particles" />
<meta property="og:description" content="Some cool canvas pixel manipulation" />
@gabeshaughnessy
gabeshaughnessy / delete_transients.php
Created July 16, 2014 02:08
Delete all the transients from the options table
<?php
global $wpdb;
$wpdb->query("DELETE FROM `wp_options` WHERE `option_name` LIKE ('_transient_%')");
?>