Skip to content

Instantly share code, notes, and snippets.

View davatron5000's full-sized avatar
🚀
Making Luro

Dave Rupert davatron5000

🚀
Making Luro
View GitHub Profile
<?php
/**
* Plugin Name: Timejump
* Plugin URI: http://davatron5000.github.io/TimeJump
* Description: Deep linking for podcasts
* Version: 1.0
* Author: Dave Rupert
* Author URI: http://daverupert.com
* License: MIT/GPL2
*/
var tds = document.querySelectorAll('td');
for(i=0;i<tds.length;i++) {
var td = tds[i];
var txt = td.textContent.trim();
if(txt == 'Yes') {
td.style.backgroundColor = 'rgba(0,255,0,0.1)';
} else if(txt == 'No' ){
td.style.backgroundColor = 'rgba(255,0,0,0.1)';
}
}
@davatron5000
davatron5000 / civil-hack-app-ideas.md
Created June 26, 2014 15:24
Civil hack app ideas

Some civic hack app ideas that I've been mulling around.

Map of child obesity by school district

In order to bring about continued awareness of child obesity and to bring school districts greater accountability about what they're doing to combat the epidemic, a map of each school district color coded by avg-BMI.

Fat-shaming school districts, basically.

Popular Vote App: Representative vs. Constituents

@davatron5000
davatron5000 / critical-mishaps.md
Created July 31, 2014 15:52
Critical Mishaps

Things not being picked up by my critical CSS task that I have to manually update.

  • h1 - excusable, being used on another page
  • h2 - media-queries? - would need to confirm this.
  • .archive-list - maybe because only the top of the module is in-view, not the whole module?
  • @font-face included - slows the site down
  • pre - codeblocks on posts have long, unbreaking strings. This was causing first layout paint to be 1600px wide on mobile.
struct もじれつ: Printable {
let description: String
init(string: String) {
var mutableString = NSMutableString(string: string) as CFMutableString
if CFStringTransform(mutableString, nil, kCFStringTransformLatinHiragana, 0) == 1 {
self.description = mutableString as NSString
} else {
self.description = string
}
@davatron5000
davatron5000 / gulpfile.js
Last active August 29, 2015 14:13
gulp.src ➡️ icons.json
// I have a list SVG icons that I'm using svg-store on, but I'd also like to
// just throw out some JSON so I could loop through icons for my styleguide.
gulp.task('list-icons', function () {
gulp.src('assets/icons/*.svg')
// write list of matched filenames to icons.json
});

Every browser is the new IE (to me)

There's been a lot of talk lately about "the New IE". Heck, the Verge even tried to blame all their performance problems on it. There's also been a lot of great (and not-so great) criticism about it.

  IE/Edge Firefox Chrome Opera Safari Mobile Safari Opera Mini
<picture> X X X X
<svg><use> X X X
CORS Support for <use xlink:href> X X X X X X X
Service Worker X X X X X
@davatron5000
davatron5000 / southwestSort.js
Last active August 29, 2015 14:26
southwestSort
var letters = ["q","w","e","r","t","y","u","i","o","p","a","s","d","f","g","h","j","k","l","z","x","c","v","b","n","m"];
function southwestSort( arr ) {
var a = arr.slice( 0, Math.floor(arr.length / 3) );
var b = arr.slice( Math.floor(arr.length / 3), Math.floor(arr.length / 3)*2 );
var c = arr.slice( Math.floor(arr.length / 3)*2, arr.length );
return a.sort().concat(b.sort()).concat(c.sort());
}
@davatron5000
davatron5000 / jquery.sortbydata.js
Created April 19, 2011 01:23
jQuery.sortByData
/*
* SortByData
* Copyright 2011 Dave Rupert
* www.daverupert.com
*
* Version 1.0 - Updated: Apr. 18, 2011
* Requires jQuery 1.5+
*
* This Plug-In sorts a list of of elements by any HTML5 data-attribute you specify.
* It can also handle doing that by ASC or DESC order.
@davatron5000
davatron5000 / gist:987162
Created May 23, 2011 17:58
ATX Mini-Conf Topics
Comment to list mini-conf workshops you want.