Skip to content

Instantly share code, notes, and snippets.

View bluehazetech's full-sized avatar

Brian Turgeon bluehazetech

View GitHub Profile
@bluehazetech
bluehazetech / sass-mixins
Last active November 30, 2022 15:16
Sass: Mixins
@function strip-units($number) {
@return $number / ($number * 0 + 1);
}
@mixin font-size($size: 16, $line: 1.5) {
font-size: $size + px;
font-size: ($size / 10) + rem;
@if unitless($line) {
line-height: $line;
} @else {
@bluehazetech
bluehazetech / prototypal-inheritance
Last active August 29, 2015 13:56
JavaScript: Prototypal Inheritance (cross-browser)
Object.prototype.inherit = function () {
function F() {}
F.prototype = this;
return new F();
}
@bluehazetech
bluehazetech / css-media-queries
Created February 6, 2014 17:14
CSS: SCSS Breakpoints, Mixins and Usage
/*------------------------------------*\
breakpoint vars
\*------------------------------------*/
$break-320: 20em;
$break-321: 20.0625em;
$break-480: 30em;
$break-600: 37.5em;
$break-768: 48em;
$break-980: 61.25em;
$break-1024: 64em;
@bluehazetech
bluehazetech / .jshintrc
Created January 25, 2014 21:21
JavaScript: Base .jshint
{
// Settings
"maxerr" : 50, // Maximum error before stopping.
"passfail" : false, // Stop on first error.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"jquery" : true, // Globals exposed by the jQuery JavaScript library.
"node" : true, // Globals available when your code is running inside of the Node runtime environment.
@bluehazetech
bluehazetech / javascript-jquery-pubsub
Last active December 23, 2015 06:59
JavaScript: PubSub
// 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);