Skip to content

Instantly share code, notes, and snippets.

@djcommandline
djcommandline / gist:5111846
Last active December 14, 2015 15:59
JS :: Query String Parser
var QueryString = function () {
// This function is anonymous, is executed immediately and
// the return value is assigned to QueryString!
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
// If first entry with this name
if (typeof query_string[pair[0]] === "undefined") {
@djcommandline
djcommandline / gist:5111883
Last active December 14, 2015 15:59
JS :: Decode URI
decodeURIComponent(QueryString.utm_medium).replace(/\+/g, ' ')
@djcommandline
djcommandline / WP :: PHP :: wp-config.php
Last active December 15, 2015 17:38
WP :: PHP :: wp-config
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') ) {
define('ABSPATH', dirname(__FILE__) . '/');
}
/** Check if there is a local configuration settings file
if(file_exists(ABSPATH . 'wp-config.local.php')){
require_once(ABSPATH . 'wp-config.local.php');
} else {
@djcommandline
djcommandline / JS :: HTML5 :: OLD BROWSER SUPPORT
Created May 6, 2013 19:03
JS :: HTML5 :: OLD BROWSER SUPPORT
;("header footer section aside nav article figure figcaption hgroup time").replace(/\w+/g,function(a){document.createElement(a)})
@djcommandline
djcommandline / HTML5 :: BOILERPLATE
Created May 6, 2013 19:46
HTML5 :: BOILERPLATE
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
/*! normalize.css v1.1.1 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 6/7/8/9 and Firefox 3.
*/
@djcommandline
djcommandline / HTML5BP :: H+C(M+A)+F :: MARKUP
Last active December 17, 2015 01:29
HTML5BP :: H+C(M+A)+F :: MARKUP
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
@djcommandline
djcommandline / EMMET :: CSS :: .media.attribution>(a.img>img)+.bd
Created May 7, 2013 00:27
EMMET :: CSS :: .media.attribution>(a.img>img)+.bd
.media {
margin:10px;
}
.media, .bd {
overflow:hidden;
_overflow:visible;
zoom:1;
}
.media .img {
float:left;
@djcommandline
djcommandline / gist:5550156
Created May 9, 2013 20:03
Facebook and Quick Share Link Messages...
Twitter...
<a target="_blank" href="http://twitter.com/home?status=Your%20message%20here:%20http://yourshorturl.com">Share on twitter</a>
Facebook...
<a target="_blank" href="http://www.facebook.com/sharer.php?u=http://yourshorturl.com&t=Your%20message%20here.">Share on Facebook</a>
@djcommandline
djcommandline / FETCH :: CONFIG :: SUBLIME
Created July 6, 2013 19:50
FETCH :: SUBLIME :: CONFIG
{
"files":
{
"fontcustomvectors": "https://github.com/mantone/fontcustomvectors/fontcustom.yml",
"jquery": "http://code.jquery.com/jquery-latest.min.js",
"jquery_plugin": "https://raw.github.com/mantone/jquery_plugin_startkit/master/js/plugin.js",
"media_query_mixins": "https://raw.github.com/paranoida/sass-mediaqueries/master/_media-queries.scss",
"modernizr": "http://modernizr.com/downloads/modernizr-latest.js",
"normalize": "https://raw.github.com/necolas/normalize.css/master/normalize.css",
"backbone": "https://raw.github.com/jashkenas/backbone/master/backbone.js",