Skip to content

Instantly share code, notes, and snippets.

View cchiles's full-sized avatar

Chris Chiles cchiles

  • Grand Rapids, MI
View GitHub Profile
@cchiles
cchiles / gist:1d4eeb7623a32fd789e3
Created February 25, 2015 14:50
.htaccess Maintenance Page
RewriteCond %{REMOTE_ADDR} !^192\.168\.1\.1
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1
RewriteCond %{REQUEST_URI} !\.(css|js|ico|jpe?g?|png|gif) [NC]
RewriteCond %{REQUEST_URI} !^/offline\.html$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/offline.html [R=307,L]
@cchiles
cchiles / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cchiles
cchiles / jquery.placeholder.js
Created February 9, 2012 16:48
jQuery Placeholder
$.fn.placeholder = function(){
return this.each(function(){
var $this = $(this);
if($this.val() !== '') {
$(this).prev('label').removeClass('active');
}
$this.keydown(function(e){
if($(this).val() === '') {
if ((e.keyCode >= 48 && e.keyCode <= 57) ||