Skip to content

Instantly share code, notes, and snippets.

View JawsomeJason's full-sized avatar
💅
Bein' sassy

Jason Featheringham ⊙ω⊙ JawsomeJason

💅
Bein' sassy
View GitHub Profile
@JawsomeJason
JawsomeJason / CodeCache.js
Created September 21, 2013 00:00
Stores inlined JS/CSS into localStorage, and then helps you re-inject it on page reload
/**
* @fileOverview Stores inline JS/CSS into localStorage
* @author "Jason T. Featheringham" <[email protected]>
* @requires this.localStorage,
* this.document,
* this.JSON,
* this.document.querySelectorAll,
*
* How It Works:
* On your server, when you want some content stored locally instead of retrieved from the server. An example using a script file (script.js), but any DOM element will work.
@JawsomeJason
JawsomeJason / A-Pen-by-Jason-Featheringham.markdown
Last active September 25, 2016 09:16
Edge to Edge, a jQuery plugin that helps fit text to the edges of its container.

jQuery Edge-to-Edge Plugin

It finds the optimum font size to fit a certain container width. Coolest thing: It does this by shrinking/growing the font by half of the last attempt until it finds the sweet spot [ O(log n): 154px font = max 8 checks ]. There might be a slight visual offset between two headers one on top of the other. This is due to no checking on letter-spacing. That might incur a greater performance hit, as we'd be getting into floating-point pixels.

A Pen by Jason Featheringham on CodePen.

License.

@JawsomeJason
JawsomeJason / jquery.plugin.js
Created August 4, 2012 04:10
jQuery Plugin Boilerplate
"use strict";
/* boilerplate from: http://stefangabos.ro/jquery/jquery-plugin-boilerplate/ */
( function( $ ) {
$.fn.pluginName = function( method ) {
var methods = {
// constructor