Skip to content

Instantly share code, notes, and snippets.

<?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;
// Check if the cached file is still fresh. If it is, serve it up and exit.
if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) {
include($cachefile);
exit;
}
@Geruhn
Geruhn / .gitconfig
Last active December 21, 2015 14:28
Git: Standard .gitconfig
[color]
ui = true
[alias]
go = checkout
ci = commit -m
st = status
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
type = cat-file -t
@Geruhn
Geruhn / gist:6303666
Created August 22, 2013 06:00
CSS: Image Replacement
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@Geruhn
Geruhn / gist:6291349
Last active December 21, 2015 10:19
JavaScript: jsChecker
$(document).ready(function() {
var jsChecked = document.createAttribute('class');
jsChecked.nodeValue = 'js';
document.getElementsByTagName('body')[0].setAttributeNode(jsChecked);
});