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
// Works in modern browsers + IE9, but Modernizr has a polyfill baked in for function.bind. | |
// Hat tip Paul Irish | |
var o = $( {} ); | |
$.subscribe = o.on.bind(o); | |
$.unsubscribe = o.off.bind(o); | |
$.publish = o.trigger.bind(o); | |
// Usage | |
$(document.body).on( 'click', function() { |
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($){ | |
var o = $( {} ); | |
$.each({ | |
on: 'subscribe', | |
trigger: 'publish', | |
off: 'unsubscripbe' | |
}, function( key, api ) { | |
$[api] = function() { | |
o[key].apply( o, arguments ); |
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
// Prevent long urls and text from breaking layouts | |
// [originally from perishablepress.com](http://perishablepress.com/press/2010/06/01/wrapping-content/) | |
@mixin force-wrap { | |
white-space: pre; // CSS 2.0 | |
white-space: pre-wrap; // CSS 2.1 | |
white-space: pre-line; // CSS 3.0 | |
white-space: -pre-wrap; // Opera 4-6 | |
white-space: -o-pre-wrap; // Opera 7 | |
white-space: -moz-pre-wrap; // Mozilla | |
white-space: -hp-pre-wrap; // HP Printers |
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://techtime.getharvest.com/blog/in-defense-of-rem-units */ | |
html | |
font-size: 16px | |
@media screen and (min-width: 1600px) // Large Monitors | |
font-size: 18px | |
@media screen and (min-width: 1400px) // Small Laptops | |
font-size: 14px | |
@media screen and (min-width: 1100px) // Tablet Landscape |