Skip to content

Instantly share code, notes, and snippets.

View bluehazetech's full-sized avatar

Brian Turgeon bluehazetech

View GitHub Profile
@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);
@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 / 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 / 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 / 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 / css-scrollbar
Last active August 29, 2015 13:57
CSS: Scrollbar
@media only screen and (min-width: 767px) {
::-webkit-scrollbar {
width: 12px;
height: 12px;
background-color: $xxLightGrey;
}
::-webkit-scrollbar-thumb {
background-color: $darkBlue;
-webkit-border-radius: 5px;
}
@bluehazetech
bluehazetech / css-svg-images
Created March 25, 2014 12:27
CSS: SVG Images
<!-- inline SVG with inline fallback -->
<object data="image.svg" type="image/svg+xml">
<img src="image.png" />
</object>
<!-- inline SVG with CSS fallback using Modernizr -->
<object data="image.svg" type="image/svg+xml" class="svg">
SVG Image <!-- CSS fallback image -->
</object>
@bluehazetech
bluehazetech / dotfile-gitignore
Created March 30, 2014 01:50
Dotfile: gitignore
*.sublime-*
!.gitkeep
bin
dist
logs/*
node_modules/
tmp
.DS_Store
.idea
.sass-cache
@bluehazetech
bluehazetech / dotfile-sublime-settings
Last active August 29, 2015 13:57
Dotfile: Sublime Settings
{
"binary_file_patterns":
[
"humans.txt",
"robots.txt",
"*jquery*.js",
"*.min.js"
],
"caret_style": "blink",
"color_scheme": "Packages/User/Tomorrow-Night (SL).tmTheme",
@bluehazetech
bluehazetech / dotfile-gitconfig
Created March 31, 2014 00:40
Dotfile: gitconfig
[color]
ui = auto
[push]
default = simple
[mergetool "sublime"]
cmd = subl -w $MERGED
trustExitCode = false
[merge]
tool = sublime
[core]