This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Requires underscore or lodash for isUndefined() | |
var $cache = {}; | |
/** | |
* Returns the page title element and will set the page title element when it doesn't exist | |
* @param {String} selector | |
* @returns {jQuery} | |
*/ | |
getElement: function getElement(selector) { | |
if (typeof selector !== 'string') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Plugin to get query params as an object | |
jQuery.extend({ | |
getQueryParameters : function(str) { | |
return (str || document.location.search).replace(/(^\?)/,'').split("&").map(function(n){return n = n.split("="),this[n[0]] = n[1],this}.bind({}))[0]; | |
} | |
}); | |
// EXAMPLE | |
// http://codepen.io/chriscoyier/pen/uszCr?lunch=sandwich&dinner=stirfry | |
var queryParams = $.getQueryParameters(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// strip-units() | |
// Remove units from a Sass value with units (em, px, etc.) | |
// http://stackoverflow.com/questions/12328259/how-do-you-strip-the-unit-from-any-number-in-sass#answer-12335841 | |
// EXAMPLE | |
// strip-units($my-var); | |
@function strip-units($number) { | |
@return $number / ($number * 0 + 1); | |
} | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:text/html,<html contenteditable> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* FIXED and FLUID RATIOs | |
* http://voormedia.com/blog/2012/11/responsive-background-images-with-fixed-or-fluid-aspect-ratios | |
*/ | |
/** | |
* FIXED RATIO | |
<div class="column"> | |
<figure class="fixedratio"></figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* http://www.zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement/ */ | |
overflow: hidden; | |
text-indent: 100%; | |
white-space: nowrap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using media queries in Sass with ESRG Grid Generator (https://github.com/dfcb/extra-strength-responsive-grids) | |
@import 'grid.generator.scss' // (https://github.com/dfcb/extra-strength-responsive-grids/blob/master/css/_grid.generator.scss) | |
// Media query mixin used below (should live in another file) | |
@mixin mq($media_query) { | |
@media ($media_query) { @content; } | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Google Analytics Tracking | |
* | |
* Abstracting Google Analytics basic _trackEvent and _trackPageview | |
* Easily extended to support specific use cases | |
*/ | |
var TRACK = (function($) { // Yes I know, TRACK is a global variable poluting the global namespace | |
//////////////////////////////////////////////// Example calls (maybe not the best place for them) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>Ring Pulsers</title> | |
<style type="text/css" media="screen"> | |
.marker { | |
left: 150px; | |
height: 100px; | |
position: absolute; |
NewerOlder