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 _getCarat(el) { | |
if (el.selectionStart) { | |
return el.selectionStart; | |
} else if (document.selection) { | |
el.focus(); | |
var r = document.selection.createRange(); | |
if (r == null) { | |
return 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
//============================================================ | |
// Typography | |
//============================================================ | |
// An rem font-size mixin providing fallback to px | |
@mixin font-size($sizeValue: 1.4) { | |
$remValue: $sizeValue; | |
$pxValue: ($sizeValue * 10); | |
font-size: #{$pxValue}px; | |
font-size: #{$remValue}rem; |
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
//============================================================ | |
// Structure, Flow and Layout | |
//============================================================ | |
// inline-block fix incl. ie7 support | |
.inline-block { | |
display: inline-block; | |
*display: block; | |
*zoom: 1; | |
} |
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
# This command will make sure the process persists | |
# even after you log out of a session | |
node server.js >/dev/null 2>&1 & |
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
/* | |
* There's a bug in Chrome/Safari using overflow:hidden with border-radius. This mask fixes it. | |
* Solution: http://stackoverflow.com/questions/5736503/how-to-make-css3-rounded-corners-hide-overflow-in-chrome-opera/10296258#10296258 | |
*/ | |
.masked { | |
position: absolute; | |
border-radius: 10px; | |
overflow: hidden; | |
/* this fixes the overflow:hidden in Chrome */ | |
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC); |
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
/** | |
* Strips protocols off strings. | |
* Usefull for ensuring a consistent base where user input is involved. | |
* | |
* Matches: | |
* http:// | |
* https:// | |
* ftp:// | |
* mailto: | |
* www. |
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
/** | |
* Converts newline characters to HTML <br /> elements | |
* | |
* @author Adam Brewer - @adamcbrewer - adamcbrewer.com | |
* | |
* Usage: "String goes\n\rhere".nl2br(); | |
* | |
*/ | |
String.prototype.nl2br = function () { | |
return this.replace(/(\r\n|\n|\r)/gm, "<br />"); |
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
/** | |
* Converts a URL query string to a javascript object | |
* | |
* @author Adam Brewer - @adamcbrewer - adamcbrewer.com | |
* | |
* Usage: "?test=true&something=false".queryToObj(?); | |
* | |
* Output: {test: true, something: false} | |
* | |
*/ |
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
/** | |
* A Google Analytics event tracking proxy. | |
* | |
* This lobal allows us to do tests for the instantiation of _gaq | |
* and also allows us easier debugging in a test environment. | |
* | |
* Hat-tip to @stugoo for most the self-invoked function features! | |
* | |
*/ | |
window.track = function (args) { |
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
/** | |
* An extend function to merge some default arguments | |
* with those passed in from the user. | |
* | |
* @param {object} obj The default settings | |
* @param {object} extObj Arguments from the user | |
* @return {object} A merged object | |
* | |
*/ | |
var extend = function (obj, extObj) { |