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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
// Brightness math based on: | |
// http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx | |
$red-magic-number: 241; | |
$green-magic-number: 691; | |
$blue-magic-number: 68; | |
$brightness-divisor: $red-magic-number + $green-magic-number + $blue-magic-number; | |
@function brightness($color) { | |
// Extract color components |
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
function getViewportOffset(element) { | |
var node = element | |
, left = node.offsetLeft | |
, top = node.offsetTop | |
; | |
node = node.parentNode; | |
do { | |
var styles = getComputedStyle(node); |
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
// ---- | |
// Sass (v3.3.0.rc.2) | |
// Compass (v1.0.0.alpha.17) | |
// ---- | |
// | |
// map-fetch($map, $keys) | |
// | |
// An easy way to fetch a deep value in a multi-level map. Works much like | |
// map-get() except that you pass multiple keys as the second parameter to |
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
=style-link($link-color: blue, $visited-color: purple, $hover-color: red) | |
&:link | |
color: $link-color | |
text-decoration: underline | |
&:visited | |
color: $visited-color | |
&:hover | |
color: $hover-color | |
text-decoration: none |
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
/* | |
* jquery.autogrow.js | |
* | |
* A plugin written for UserVoice that makes it easy to create textareas | |
* that automatically resize to fit their contents. | |
* | |
* Based on Scott Moonen's original code for Prototype.js: | |
* | |
* <http://scottmoonen.com/2008/07/08/unobtrusive-javascript-expandable-textareas/> | |
* |
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
// Modified Meyer reset | |
// Universal selector works great! | |
// See: http://blogs.telerik.com/kendoui/posts/12-09-28/css_tip_star_selector_not_that_bad | |
*, *::before, *::after { | |
margin: 0; | |
padding: 0; | |
border: 0; | |
border-collapse: collapse; | |
border-spacing: 0; |
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
// micro-reset.scss | |
// | |
// Based on the Meyer reset | |
// Universal selector works great! | |
// See: http://blogs.telerik.com/kendoui/posts/12-09-28/css_tip_star_selector_not_that_bad | |
*, *::before, *::after { | |
margin: 0; | |
padding: 0; | |
border: 0; |
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
section.three-column-grid { | |
clear: both; | |
width: 960px; | |
@include clearfix; | |
> section { | |
float: left; | |
padding: 0 10px; | |
width: 300px; |
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
/** | |
* prepareTransition | |
* | |
* jQuery Plugin for ensuring transitions with display:none or visibility:hidden | |
* are in the right state until the end of the transition | |
* | |
* By John W. Long (http://wiseheartdesign.com) | |
* April 18, 2013 | |
* | |
* Based on the prepareTransition plugin by Jonathan Snook (http://snook.ca). This version |
NewerOlder