Skip to content

Instantly share code, notes, and snippets.

View amaxwell01's full-sized avatar

Andrew Maxwell amaxwell01

View GitHub Profile
@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 / custompostquery.php
Created July 29, 2012 21:31
Simple and clean wordpress custom post query
<ul>
<?php
$wp_query = new WP_Query( array(
'post_type' => 'gallery',
'posts_per_page' => -1
));
if( have_posts() ) {
while ( $wp_query->have_posts() ) {
$wp_query->the_post();
@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 / interviewitems.MD
Created September 15, 2012 14:17
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@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 {