View css-sass-helpers.scss
//============================================================
// 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;
View css-less-helpers.less
//============================================================
// Structure, Flow and Layout
//============================================================
// inline-block fix incl. ie7 support
.inline-block {
display: inline-block;
*display: block;
*zoom: 1;
}
View node.sh
# This command will make sure the process persists
# even after you log out of a session
node server.js >/dev/null 2>&1 &
View webkit-css-mask.css
/*
* 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);
View stripProtocols.js
/**
* Strips protocols off strings.
* Usefull for ensuring a consistent base where user input is involved.
*
* Matches:
* http://
* https://
* ftp://
* mailto:
* www.
View nl2br.js
/**
* 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 />");
View queryToObject.js
/**
* 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}
*
*/
View ga-tracker.js
/**
* 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) {
View extend.js
/**
* 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) {
View clickEventType.js
/**
* Using default click events in touch-supported devices
* incurs a delay (in order to determine if the user is performing a gesture).
*
* Detecting for touchstart events using the foloowing, we can replace the default 'clicks'
* for touch events, making a snappier experience for mobile/touch devices.
* Use wisely as this could prevent some gestures from happening. If there are scrolling
* issues try swap out 'touchstart' for 'touchend'
*
*/