Skip to content

Instantly share code, notes, and snippets.

👋
he/him/his

Aaron Gustafson aarongustafson

👋
he/him/his
View GitHub Profile
@aarongustafson
aarongustafson / responsive-iframes.css
Created Oct 25, 2011
Responsive iFrames with jQuery
View responsive-iframes.css
iframe {
max-width: 100%;
}
View osx-special-chars.ahk
#UseHook
!VKC0SC029::Return ; grave -> the grave ` accent gave some probs, used the virtualkey + scancode instead
!e::Return ; acute
!i::Return ; circumflex
!t::Return ; tilde
!u::Return ; umlaut
; 1 2 3 4 5 6 7 8 9 1
; 0
; r g G a A c C t T u U
@aarongustafson
aarongustafson / basic-manifest.json
Last active Jan 29, 2020
Working with multi-lingual manifest files
View basic-manifest.json
{
"lang": "en-US",
"name": "Aaron Gustafson",
"short_name": "AaronG",
"scope": "/",
"display": "minimal-ui",
"start_url": "/",
"theme_color": "#27831B",
"description": "The online home and work of Aaron Gustafson.",
"orientation": "any",
@aarongustafson
aarongustafson / watchResize.js
Last active Sep 16, 2019
Efficient callback management for window.onresize
View watchResize.js
(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 / strapless.js
Last active May 12, 2019
A simple way to remove Bootstrap’s formatting and JavaScript influence
View strapless.js
(function(){
var body = document.body,
css = document.querySelectorAll('[href*=bootstrap][href$=css]'),
css_len = css.length,
js = document.querySelectorAll('[src*=bootstrap][src$=js]'),
js_len = js.length,
xhr = new XMLHttpRequest(),
strapped = false;
@aarongustafson
aarongustafson / TinyMCE-config-HTML5.js
Created Aug 26, 2010
Working on a TinyMCE config that supports HTML5
View TinyMCE-config-HTML5.js
// General
button_tile_map : true,
editor_selector : 'lg_mceEditor',
mode:'textareas',
theme : 'advanced',
// Cleanup/Output
apply_source_formatting : true,
convert_fonts_to_spans : true,
convert_newlines_to_brs : false,
@aarongustafson
aarongustafson / better-labels.html
Last active Dec 13, 2018
Code samples from my EnhanceConf 2016 talk
View better-labels.html
<label for="first_name">What’s your first name?</label>
<input name="first_name" id="first_name">
@aarongustafson
aarongustafson / backup-to-s3.sh
Created Jan 22, 2014
backup to S3 as a shell command (uses s3cmd)
View backup-to-s3.sh
#!/bin/bash
##
# Backup Server to S3 script
#
# Creates a local cached backup of the source folder using rsync and then
# synchronises that with Amazon S3.
#
#
# It is assumed you have rsync installed on the server.
View ala-audio-width-download-fallback.html
<figure id="">
<audio controls>
<source src="http://alistapart.com/d/misc-images/comment-edit.mp3" type="audio/mp3">
<source src="http://alistapart.com/d/misc-images/comment-edit.ogg" type="audio/ogg">
<!-- fall back to a simple image -->
<p>Your browser doesn't support HTML5 audio, but you can <a href="http://alistapart.com/d/misc-images/comment-edit.mp3">download the MP3</a> instead.</p>
View backup-to-git.sh
#!/bin/bash
##
# MySQL DB dump to Git commit
#
# Dumps the specified mysql database to the given location and commits it and
# the previous database to the Git repository.
#
# It is assumed you have already setup the Git respository to only be the
# a checkout of the database backup location
You can’t perform that action at this time.