Skip to content

Instantly share code, notes, and snippets.

View amaxwell01's full-sized avatar

Andrew Maxwell amaxwell01

View GitHub Profile
<snippet>
<content><![CDATA[
/* ===========================================================================
${1:title}
* ${2:content}
*
* @param <String> tag
* @return <Element> element
========================================================================== */
]]></content>
<snippet>
<content><![CDATA[
/* ==========================================================================
Bug #${1:12345} - ACM - ${2:01/01/14}
* ${3:Reason}
========================================================================== */
]]></content>
<tabTrigger>jsBug</tabTrigger>
</snippet>
@amaxwell01
amaxwell01 / parseURLString.js
Created June 20, 2012 23:19
Retrieves the key value pairs in a URL string and places them in an object for easy look-up
/**
* Retrieves the key value pairs in a URL sring
* and places them in an object for easy lookup
*/
var parseURLString = function( string ) {
var a = document.createElement("a");
a.href = string;
//hide it from view when it is added
@amaxwell01
amaxwell01 / slidecontact.html
Created June 27, 2012 12:11
Simple contact slideout
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<script>
var showSlide = function() {
$('#sideContact').show( 'slide', { direction: 'left' }, 500 );
};
@amaxwell01
amaxwell01 / README.md
Created July 19, 2012 14:41
Sass line-number inclusion

Sass line-number inclusion

Goal:

To be able to pass in a Sass command line option and have it include the true line-number of the css selector, into the style properties of the generated css file. This will allow you to easily jump to the line number for a selector vs having to try and do a [ctrl/cmd + f] in your code. This is different than [:debug_info] as it will actually include the line number in the css code that the browser shows us. For example:

Command line script

sass --watch --style :expanded :line-numbers sass:css
@amaxwell01
amaxwell01 / single-gallery.php
Created July 23, 2012 03:05
Custom Post Previous and Next functionality
@amaxwell01
amaxwell01 / urlparse.js
Created July 30, 2012 21:56
A simple way to parse URL parameters from a static string
// This function creates a new anchor element and uses location
// properties (inherent) to get the desired URL data. Some String
// operations are used (to normalize results across browsers).
function parseURL(url) {
var a = document.createElement('a');
a.href = url;
return {
source: url,
protocol: a.protocol.replace(':',''),
host: a.hostname,
@amaxwell01
amaxwell01 / buttonBlink.js
Created August 1, 2012 05:27
Simple Blinking Button
@amaxwell01
amaxwell01 / multiple-ga-accounts.html
Created September 20, 2012 16:12
How to have 2 or more Google Analytics accounts and events on a single web page
<html>
<head>
<title>Test Multiple Google Analytics on a single page</title>
<script type="text/javascript">
var _gaq = _gaq || [];
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
@amaxwell01
amaxwell01 / clearfloats.scss
Created September 20, 2012 20:26
Clearing floats and fixing overflow issues. Clearfix
// SASS CODE
.clearfix {
*zoom: 1;
&:before,
&:after {
content: "";
display: table;
line-height: 0;
}
&:after {