Skip to content

Instantly share code, notes, and snippets.

View dtipson's full-sized avatar

Drew dtipson

View GitHub Profile
@dtipson
dtipson / batching a CORS request as a backup
Created February 10, 2012 16:46
bit of code (part of a larger object not shown) that handles batching of a huge CORS POST into several JSONP requests. The rwJSONP function returns a promise
batchIt: function(q){
var b = $.Deferred(),
batches = [],
per=3,
nq,
nids=[];
$.each(q.ids,function(i,v){
nids.push(v);
if (nids.length===per) {
@dtipson
dtipson / wulf.md
Created June 19, 2012 19:42
Bill Wulf's Resignation Letter

Comp. Sci. Prof. William Wulf’s resignation letter

BY on June 19, 2012

Below is a resignation letter submitted [to the Cavalier Daily] this morning by Computer Science Prof. William Wulf:

Dean and Interim President Zeithaml,

By this email I am submitting my resignation, effective immediately. I do not wish to be associated with an institution being as badly run as the current UVa. A BOV that so poorly understands UVa, and academic culture more generally, is going to make a lot more dumb decisions, so the University is headed for disaster, and I don’t want to be any part of that. And, frankly, I think you should be ashamed to be party to this debacle!

(function($, M) {
var $html = $('html'),
mprops = {},
report='',
ieon = false,
ies = {
54: 'oldie lt-ie10 lt-ie9 lt-ie8 lt-ie7', //ie6
55: 'ie7 oldie lt-ie10 lt-ie9 lt-ie8', //ie7
56: 'ie8 oldie lt-ie10 lt-ie9', //ie8
javascript:(function(){ yepnope({test: typeof jQuery=='undefined' && typeof bQuery=='undefined',yep: '//code.jquery.com/jquery-1.9.1.min.js',both: 'https://gist.github.com/dtipson/4740803/raw/6592ff3e08bf07dd1134e1a01eebcb180c0d10fa/modernizr-toggle.js'
}); }());
@dtipson
dtipson / dabblet.css
Created March 4, 2013 22:10 — forked from LeaVerou/dabblet.css
Failed attempt at gracefully degrading switch-style checkboxes
/**
* Failed attempt at gracefully degrading switch-style checkboxes
* without pseudoelements (which shouldn’t exist on replaced elements) and extra elements.
* Inspired by Espresso’s “Tools” switch
* DO NOT USE. Currently only works properly in WebKit :(
*/
input[type="checkbox"]:not(:checked)+label,
input[type="checkbox"]:checked+label { /* :checked here acting as a filter for older browsers */
appearance: none;
@dtipson
dtipson / dabblet.css
Created March 15, 2013 21:53 — forked from LeaVerou/dabblet.css
Switch-style checkboxes.
/**
* Switch-style checkboxes.
* Inspired by Espresso’s “Tools” switch
*/
input[type="checkbox"]:not(:checked),
input[type="checkbox"]:checked { /* :checked here acting as a filter for older browsers */
position: absolute;
opacity: 0;
}
function jandocme(){
(function($){
var i = 0, windowWidth = $(window).width();
$('img').each(function(){
var $el = $(this),
w = $el.width(),
h = $el.height(),
src = $el.attr('src');
if(w>16 && h>16 && (src.indexOf('1px')===-1) && h<1000) { $el.attr('src','http://placejandoc.jgre.co/'+w+'-'+h+'?'+(i++)); }
});
@dtipson
dtipson / jandocer.js
Last active December 15, 2015 14:19
javascript: (function () {var jsCode = document.createElement('script');jsCode.setAttribute('src', 'https://gist.github.com/dtipson/5273244/raw/4842abcef622739be3ccda188c1a057e942b30af/jandocme.js');document.body.appendChild(jsCode);}());
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$plugin_info = array(
'pi_name' => 'URL Encode',
'pi_version' => '1.1',
'pi_author' => 'Airtype Studio / BSD',
'pi_author_url' => 'http://www.airtypestudio.com/',
'pi_description' => 'Runs urlencode on a string of text.',
@dtipson
dtipson / dabblet.css
Created June 7, 2013 14:56
SVG Share Buttons using text-align: justify
/**
* SVG Share Buttons using text-align: justify
*/
.three-share-btns {
margin:100px auto; /*just so it shows up*/
width: 118px; /*defines pretty much everything*/
height: 22px; /*works best in this case when this is predefined*/
}