Skip to content

Instantly share code, notes, and snippets.

View saltcod's full-sized avatar

Terry Sutton saltcod

View GitHub Profile
cheese
crackers?
function wpr_maintenance_mode() {
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {
wp_die('Maintenance, please come back soon.');
}
}
add_action('get_header', 'wpr_maintenance_mode');
LIVE SQL FILE
====================================================
sed 's/http:\/\/localhost:8888\/mywebsite/http:\/\/mywebsite.com/g' FileToReadFrom > FileToWriteTo
LOCAL SQL FILE
==============
sed 's/http:\/\/waterstreetgm.org/http:\/\/localhost:8888\/waterstreetgm/g' FileToReadFrom > FileToWriteTo
window.addEventListener "DOMContentLoaded", ->
body = $ "body"
canvas = $ "#canvas"
chalkboard = $ "#chalkboard"
close = $ "#close"
ledge = $ "#ledge"
lightswitch = $ "#lightswitch"
output = $ "#output"
shade = $ "#shade"
share = $ "#share"
@saltcod
saltcod / wp-eneueue
Created November 18, 2011 15:58
Enqueuing scripts in Wordpress
<?php
wp_enqueue_script(‘jquery’) ;
wp_enqueue_script(‘easing’, ‘/wp-content/themes/themeNane/js/jquery.easing.1.2.js’,false,’1.2′) ;
wp_enqueue_script(‘lTabs’, ‘/wp-content/themes/themeNane/js/lTabs.js’, array( ‘jquery-ui-core’, ‘jquery-ui-tabs’)) ;
wp_enqueue_script(‘lightbox’, ‘/wp-content/themes/themeNane/js/jquery.lightbox-0.5.js’,false, ’0.5′);
wp_head();
?>
Three men walk into a hotel to rent a room. The room costs $30.
They pay the manager $10 each.
An hour later, the manager realizes the room is just $25, and he sends the bellboy up to return the $5 he owes them.
The dishonest bellboy gives the men back $1 each, pocketing $2 for himself.
The men have now paid $9 each for the room.
@saltcod
saltcod / gist:1482251
Created December 15, 2011 18:34
Awesome Drupal markup
<!-- main row: width = grid_width -->
<div id="main-wrapper" class="main-wrapper full-width">
<div id="main" class="main row grid16-16">
<div id="main-inner" class="main-inner inner clearfix">
<!-- main group: width = grid_width - sidebar_first_width -->
<div id="main-group" class="main-group row nested grid16-16">
<div id="main-group-inner" class="main-group-inner inner">
<div id="main-content" class="main-content row nested">
@saltcod
saltcod / gist:2061561
Created March 17, 2012 16:11
Menu panels
// Paginate the portfolio
$('ul#menu-portfolio > li:gt(11)').hide();
$('.prev').click(function() {
var first = $('ul#menu-portfolio').children('li:visible:first');
first.prevAll(':lt(12)').show('fast');
first.prev().nextAll().hide();
});
@saltcod
saltcod / functions.php
Created March 27, 2012 17:57 — forked from anonymous/functions.php
functions page
<?php
/* Uncomment to put site in maintenance mode */
function wpr_maintenance_mode() {<br />
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {<br />
wp_die('Doing a small upgrade, please come back in about an hour!');<br />
}<br />
}<br />
add_action('get_header', 'wpr_maintenance_mode');
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Matthew Byrne</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="styles.css" type="text/css" media="screen" charset="utf-8">