Skip to content

Instantly share code, notes, and snippets.

View nelsonJM's full-sized avatar

Josh Nelson nelsonJM

View GitHub Profile
@nelsonJM
nelsonJM / gist:9627125
Created March 18, 2014 19:06
Template for Documenting a WordPress function
/**
* Short Description
*
* Long Description
*
* @package WordPress
* @since version
*
* @param type $varname Description
* @return type Description
@nelsonJM
nelsonJM / gist:10261306
Created April 9, 2014 12:04
jQuery: Disable checkboxes
(function($) {
$('#framesize-section').html('<input id="enable-checkboxes" type="checkbox"><label>Enable</label>');
var noNews = '<input type="checkbox" id="no-news"><label>No thanks</label>';
var yesNews = '<input type="checkbox" id="yes-news"><label>Yes, please</label>';
$('#message').append(noNews);
$('#message').append(yesNews);
var enable = $('#enable-checkboxes');
var disabledInputs = $('#accessories-section').find('input[type=checkbox]');
@nelsonJM
nelsonJM / .profile
Created April 10, 2014 16:56
Ubuntu: my .profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
@nelsonJM
nelsonJM / .bash_profile
Created April 10, 2014 16:59
Ubuntu: my .bash_profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
source ~/.profile
@nelsonJM
nelsonJM / .bash_aliases
Created April 10, 2014 17:00
Ubuntu: my .bash_aliases
# My aliases
# to start compass
alias mycompass='source /home/josh/.rvm/scripts/rvm'
# to mount shared drive
alias devshare='sudo mount -t vboxsf devshare ~/devshare'
alias locals='sudo mount -t vboxsf Local-SS ~/Local-SS'
# to start, stop, and restart xampp
alias xamppstart='sudo /opt/lampp/lampp start'
@nelsonJM
nelsonJM / .bashrc
Created April 10, 2014 17:01
Ubuntu: my .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
@nelsonJM
nelsonJM / test-snippet.html
Created September 18, 2012 12:05
HTML: Starting Template
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
@nelsonJM
nelsonJM / gist:3742789
Created September 18, 2012 12:11
CSS: Image Replacement
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@nelsonJM
nelsonJM / gist:3949090
Created October 24, 2012 21:40
JS: GA Cookie Script
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write("<script src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'>" + "</sc" + "ript>");
</script>
<script type='text/javascript'>
var pageTracker = _gat._getTracker("UA-XXXXXXX-X");
pageTracker._trackPageview();
//
@nelsonJM
nelsonJM / gist:3949019
Created October 24, 2012 21:29
PHP: Find Server Root
<?= $_SERVER['DOCUMENT_ROOT']; ?>