Skip to content

Instantly share code, notes, and snippets.

@wihodges
wihodges / Auto Param Push
Created April 26, 2012 19:17
Append all urls with current page URL parameters - JS
$(document).ready(function(){
elements = $('.openURL');
passMe = window.location.href.slice(window.location.href.indexOf('?'));
elements.each(function() {
url = $(this).attr("href");
newURL = url + passMe;
$(this).attr("href", newURL);
});
});
@wihodges
wihodges / JS Param GET
Created April 26, 2012 19:20
JS get param and print into form value
$(document).ready(function (){
$.urlParam = function(name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
if (results==null){return null;}
else{return results[1] || 0;}
}
console.log($.urlParam('seng'));
$('#locationtoprint').attr('value', $.urlParam("param1"));
@wihodges
wihodges / prev-next-pagination
Last active December 31, 2015 19:09
Previous/Next pagination for Statamic entries.
<div class="pagination">
{{ if prev }}
<div class="previous">
<a href="{{ prev }}">Previous</a>
</div>
{{ endif }}
{{ if next }}
<div class="next">
<a href="{{ next }}">Next</a>
</div>
@wihodges
wihodges / gist:8478326
Created January 17, 2014 18:03
Foundation 5 + Statamic Theme Gruntfile
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
includePaths: ['bower_components/foundation/scss']
},
dist: {
options: {
@wihodges
wihodges / osx-10.11-setup.md
Created December 10, 2015 21:00 — forked from kevinelliott/osx-10.11-setup.md
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

@wihodges
wihodges / 0_reuse_code.js
Created January 13, 2016 18:24
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
(function() {
var m = void 0,
n = !0,
p = null,
q = !1,
s = {};
window.nogic = s;
function t(a, c, d, b, e, f, g, h, y, k, u) {
this.n = f;
@wihodges
wihodges / gist:7362ece9a6f373ea896a65bde99b7fc3
Last active July 18, 2018 03:13
Regex in Atom for all GA Tracking codes
//FIND ALL
UA-([0-9])\w+-[0-9]
REPLACE WITH WHATEVER