Skip to content

Instantly share code, notes, and snippets.

View aarongustafson's full-sized avatar
👋
he/him/his

Aaron Gustafson aarongustafson

👋
he/him/his
View GitHub Profile
@aarongustafson
aarongustafson / responsive-iframes.css
Created October 25, 2011 17:07
Responsive iFrames with jQuery
iframe {
max-width: 100%;
}
@aarongustafson
aarongustafson / find-webkit-prefix.sh
Created February 9, 2012 15:22
Finds CSS files with -webkit- prefixes in them
find /var/www -type f -name "*.css" -exec grep -il "webkit" {} \;
@aarongustafson
aarongustafson / iir-retina.css
Created April 14, 2012 12:46
Code examples for iIR Redux
@media only screen and (-moz-min-device-pixel-ratio: 2),
only screen and (-ms-min-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2),
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-device-pixel-ratio: 2)
{
#social-links img {
background: top left no-repeat;
background-size: 25px 25px;
display: inline-block;
@aarongustafson
aarongustafson / opengraph.html
Created April 23, 2012 20:14
Snippets from my “Don’t Sell Out Your Users” blog post
<meta property="og:site_name" content="The Easy Designs Blog"/>
<meta property="og:image" content="/i/facebook-icon.png?v=20111226"/>
<meta property="og:locale" content="en_US"/>
<meta property="fb:admins" content="aaronmgustafson"/>
<meta property="og:type" content="article"/>
<meta property="og:title" content="Don’t Sell Out Your Users"/>
<meta property="og:description" content="Most sites have exhaustive Privacy Policies detailing what information they collect and what they may do with it, which is why I find it bizarre that many of these same sites have chosen to hand over their users’ browsing habits to third parties such as Twitter, Facebook, and Google without considering the implications."/>
<meta property="og:url" content="http://blog.easy-designs.net/archives/2012/04/23/dont-sell-out-your-users/"/>
@aarongustafson
aarongustafson / watchResize.js
Last active September 16, 2019 14:37
Efficient callback management for window.onresize
(function( window ){
window.watchResize = function( callback ){
var resizing;
callback.size = 0;
function done()
{
var curr_size = window.innerWidth;
clearTimeout( resizing );
resizing = null;
// only run on a true resize
@aarongustafson
aarongustafson / undoing-tables.html
Last active May 17, 2024 04:31
A Strategy for Undoing Tables
<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Email</th>
<th scope="col">Dept, Title</th>
<th scope="col">Phone</th>
</tr>
</thead>
<tbody>
@aarongustafson
aarongustafson / dependent-anchor-include.js
Last active December 19, 2015 01:38
Scott Jehl’s Anchor Include Pattern (https://gist.github.com/scottjehl/d0e4918cf5e97edf99f3) combined with Emil Bjorkund’s Width Detection (https://gist.github.com/emilbjorklund/2481019)
/*! Dependent Anchor Include Pattern */
/*
* Copyright 2011, Scott Jehl (scottjehl.com), Emil Bjorklund (thatemil.com),
* and Aaron Gustafson (aaron-gustafson.com)
*
* Dual licensed under the MIT
* Idea from Scott Gonzalez
*
* to use, place attributes on an already-functional anchor pointing to content
* that should either replace, or insert before or after that anchor
@aarongustafson
aarongustafson / easy-jail-custom-script.html
Last active December 20, 2015 02:39
Easy JAIL implementation snippets
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/j/jquery.js"><\/script>')</script>
{exp:easy_jail:js config="{offset:300}"}
@aarongustafson
aarongustafson / zoom-layouts-v2-formula.txt
Created September 16, 2013 19:30
Zoom Layouts v2 In the formula, include your width in ems (in place of X)
@media screen and (min-width: X) {
body {
font-size: ( ( 1em / X ) * 100 )vw;
}
}
@aarongustafson
aarongustafson / jquery.konamiCode.js
Last active December 27, 2015 02:19
The classic Contra cheat code in jQuery
(function($){
$.fn.konamiCode = function( callback ){
var current_keys = [],
current_keys_str = '',
unlock_code = '38 38 40 40 37 39 37 39 66 65';
$('body').on('keydown',function(e){
current_keys.push( e.keyCode );