Skip to content

Instantly share code, notes, and snippets.

Avatar

Jason Clemons jasonclemons

View GitHub Profile
@jasonclemons
jasonclemons / randomizer.php
Created Jun 15, 2016
TSA Queue Randomizer
View randomizer.php
<?php
function randLane()
{
$lane = rand(0, 1);
if ($lane == 0) {
return 'left';
} else {
return 'right';
@jasonclemons
jasonclemons / .htaccess
Created Nov 12, 2014
SMF Optimization & Backup Scripts
View .htaccess
# Turn it on
ExpiresActive On
# Set a default expiry time. One hour is fine, but a day or longer may be appropriate.
ExpiresDefault A3600
# Turn expiry off for dynamic content (or potentially dynamic content).
ExpiresByType application/x-httpd-php A0
ExpiresByType application/x-python-code A0
ExpiresByType text/html A0
@jasonclemons
jasonclemons / avatar.php
Last active Aug 29, 2015
Simple PHP script to rotate avatar images.
View avatar.php
<?php
class Avatar
{
public $avatar_dir;
public function headers()
{
header('Content-type: image/jpeg');
}
View cookie.php
@jasonclemons
jasonclemons / gist:4071712
Created Nov 14, 2012
Google Maps location finder (based on https://gist.github.com/4066383)
View gist:4071712
<?php
class GoogleMaps {
private function find($location = null) {
if ($location == null) {
return false;
}
$uri_parts = array(
'q' => urlencode($location),
'output' => 'json',
@jasonclemons
jasonclemons / rgbhex.php
Created Jul 3, 2012
Simple RGB->Hex and Hex->RGB converter.
View rgbhex.php
<?php
/**
* HEX to RGB and RGB to HEX converter
* Thanks to hafees@msn.com on php.net for the base
* http://www.php.net/manual/en/function.hexdec.php#99478
*/
/**
* Convert an RGB array to HEX
*