Skip to content

Instantly share code, notes, and snippets.

View zacscott's full-sized avatar

Zac Scott zacscott

View GitHub Profile
License Key PhpStorm 8
User Name : EMBRACE
===== LICENSE BEGIN =====
43136-12042010
00002UsvSON704l"dILe1PVx3y4"B3
49AU6oSDJrsjE8nMOQh"8HTDJHIUUh
gd1BebYc5U"6OxDbVsALB4Eb10PW8"
===== LICENSE END =====
@zacscott
zacscott / fuzzyDate.php
Last active January 2, 2016 19:09 — forked from CodeNegar/gist:3713606
Fuzzy/approx of a date in the past (php function).
<?php
/** Returns a fuzzy/approx of a date in the past. */
function fuzzyDate($date){
$time = strtotime($date);
$now = time();
$ago = $now - $time;
if ($ago < 60) {
@zacscott
zacscott / prettyJSON.php
Last active December 24, 2015 05:18
Converts to JSON, in a pretty, human readable format (yet still valid JSON).
<?php
/**
* Converts to JSON, in a 'pretty', human readable format (yet still
* valid JSON).
*
* This code was modified from this GitHub
* <a href="https://gist.github.com/GloryFish/1045396">Gist</a>.
*
* @param string $json The JSON code to prettify.