Skip to content

Instantly share code, notes, and snippets.

View oobleck's full-sized avatar
⌨️
clickety-click-click

Spencer R. oobleck

⌨️
clickety-click-click
View GitHub Profile
@oobleck
oobleck / style-guides.md
Last active October 12, 2015 17:37
My Style Guide References
@oobleck
oobleck / tbd-widget.scss
Last active December 16, 2015 22:09
Sass mixin to create a "TBD" box over any element
// DEMO http://cdpn.io/qwDxL
// Set $tbd-widget to false to globally hide the widget and restore the parent
// element without having to go find every @include
@mixin tbd-widget($width: 1em, $height: 1em, $bgColor: #ccc) {
$tbd-widget: true !default;
@if $tbd-widget {
$fgColor: invert($bgColor);
height: 0;
font-size: 0;
@oobleck
oobleck / gist:6216866
Created August 13, 2013 00:58
An userscript that adds a helpful warning that you are currently on a client CQ instance (or internal dev instance). tested in Tampermonkey (Chrome), and Greasemonkey. Update notification not working currently.
We couldn’t find that file to show.
@oobleck
oobleck / baseline-grid.scss
Created August 16, 2013 19:17 — forked from MikeAM/baseline-grid.scss
Baseline grid Sass mixin
/* Sass Mixin that generates a Baseline Grid */
/* by: Mike Morrison, Soholaunch.com */
/* You don't have to leave this credit comment in, but it would be nice of you. */
// Set your grid dimensions here
$body-width: 960px;
$baseline: 22px;
@mixin baseline-grid {
$columns: 16;
$column-color: rgba(200,0,0,.2);
@oobleck
oobleck / dev-grid.scss
Created August 16, 2013 19:51
My Grid overlay. Includes baseline grid. Just change the vars at the top to match your chosen framework. Current values are mostly from Bootstrap 2.3
$sg-base-font-size: $baseFontSize;
$sg-base-line-height: $baselineHeight;
$sg-column-width: $gridColumnWidth;
$sg-gutter-width: $gridGutterWidth;
$sg-grid-columns: $gridColumns;
$sg-grid-width: $gridRowWidth;
$sg-major-stripe: blue;
$sg-minor-stripe: green;
$sg-overlay-opacity: 0.1;
$sg-subdivs: 4;
@oobleck
oobleck / ie10plus.modernizr.js
Last active June 11, 2024 09:46
Modernizr tests for IE10 & IE11, since they removed conditional comments (and still haven't gotten browsers quite right)
// IE10
Modernizr.addTest('ie10', function() {
// http://stackoverflow.com/questions/9900311/how-do-i-target-only-internet-explorer-10-for-certain-situations-like-internet-e
'use strict';
var match = (/*@cc_on!@*/false && document.documentMode === 10);
return match;
});
// IE11
@oobleck
oobleck / queryParams.js
Created January 23, 2014 06:45
URL Query parameter helpers: 1. on-demand access function `getParam` 2. onpopstate object creation of `window.location.params`
// Inspired by http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
;(function() {
'use strict';
// On-demand retreival of query params
window.getParam = function getParam(name) {
var rxName = new RegExp('[\\?&]'+name+'[=]([^&#]*)');
var check = rxName.exec(window.location.search);
return (check === null) ? check : decodeURIComponent(check[1].replace(/\+/g, ' '));
};
@oobleck
oobleck / demo.html
Last active August 29, 2015 13:55
Simple CSS-only corner sash/ribbon. Works down to IE8.
<div class="box">
<p>The <kbd>.stash</kbd> element creates the bounding box that aligns in the corner and crops the contents at an angle. The <kbd>.sash > span</kbd> gets sized and rotated.</p>
<span class="sash">
<span>New!</span>
</span>
</div>
@oobleck
oobleck / sass-rem
Created March 9, 2014 02:52
My SCSS rem mixin, with px fallback
@mixin rem($property: font-size, $args: 1rem, $important: false) {
$em-base: 16px !default;
$accepted-units: ("px" "rem" "auto" "");
$rems: ();
$px: $rems;
@if $important != false {
$important: !important;
} @else {
$important: '';
}
@oobleck
oobleck / jquery.ittybittytmpl.js
Created March 9, 2014 02:59
jQuery plugin: Itty bitty JS templating form Thomas Fuchs, v0.1
;(function(win, doc, undefined) {
'use strict';
var pluginName = 'tmpl';
// http://mir.aculo.us/2011/03/09/little-helpers-a-tweet-sized-javascript-templating-engine/
// Exposing this for global use, just in case.
window.tmpl = function tmpl(s, d) {
for (var p in d) {
s = s.replace(new RegExp('{'+p+'}','g'), d[p]);
}