Skip to content

Instantly share code, notes, and snippets.

View wmandrews's full-sized avatar

Wilson Andrews wmandrews

View GitHub Profile
@wmandrews
wmandrews / gist:3875394
Created October 11, 2012 20:50
jQuery UI Combobox
<script type="text/javascript" src="http://www.washingtonpost.com/wp-srv/special/politics/capitol-assets/wave3/templates/js/jquery-ui-1.8.23.custom.min.js"></script>
<script>
(function($){
$(document).ready(function() {
$('#states').combobox();
$('#stateNav input').focus(function() {
if (!$(this).hasClass('clicked')) {
$(this).addClass('clicked').val('');
}
-khtml-text-shadow: 1px 1px 0 rgba(255,255,255,0.8), -1px -1px 0 rgba(255,255,255,0.8), 1px -1px 0 rgba(255,255,255,0.8), -1px 1px 0 rgba(255,255,255,0.8);
-moz-text-shadow: 1px 1px 0 rgba(255,255,255,0.8), -1px -1px 0 rgba(255,255,255,0.8), 1px -1px 0 rgba(255,255,255,0.8), -1px 1px 0 rgba(255,255,255,0.8);
-webkit-text-shadow: 1px 1px 0 rgba(255,255,255,0.8), -1px -1px 0 rgba(255,255,255,0.8), 1px -1px 0 rgba(255,255,255,0.8), -1px 1px 0 rgba(255,255,255,0.8);
text-shadow: 1px 1px 0 rgba(255,255,255,0.8), -1px -1px 0 rgba(255,255,255,0.8), 1px -1px 0 rgba(255,255,255,0.8), -1px 1px 0 rgba(255,255,255,0.8);
filter: glow(color=white,strength=1);
@wmandrews
wmandrews / gist:5991770
Last active December 19, 2015 17:29
jQuery lazy load initialization and callback
// lazy loading images
$c.find('.lazy').show().lazyload({
threshold: 600,
effect: 'fadeIn'
});
// lazyloader callback
$c.find('.lazy').load(function() {
// do something on load
});
@wmandrews
wmandrews / index.html
Last active December 24, 2015 20:29
Test for bl.ocks.
<iframe width='100%' height='600' frameBorder='0' src='http://a.tiles.mapbox.com/v3/washingtonpost.map-of3bset1.html#15/38.89074314315848/-77.00540878295898'></iframe>
@wmandrews
wmandrews / index.html
Created October 7, 2013 00:59
Google Chart Demo
<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
@wmandrews
wmandrews / index.html
Created October 12, 2013 19:16
Datawrapper Demo
<iframe src="http://cf.datawrapper.de/wtwO4/1/" frameborder="0" allowtransparency="true" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" mozallowfullscreen="mozallowfullscreen" oallowfullscreen="oallowfullscreen" msallowfullscreen="msallowfullscreen" width="100%" height="500"></iframe>
@wmandrews
wmandrews / index.html
Last active December 25, 2015 12:19
Facebook IPO Chart
<iframe src="http://cf.datawrapper.de/0GmQE/1/" frameborder="0" allowtransparency="true" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" mozallowfullscreen="mozallowfullscreen" oallowfullscreen="oallowfullscreen" msallowfullscreen="msallowfullscreen" width="100%" height="400"></iframe>
@wmandrews
wmandrews / index.html
Last active December 26, 2015 17:29
MapBox JS starter code
<!DOCTYPE html>
<html>
<head>
<!-- sets up the page for responsive content / mobile friendly -->
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<!-- imports the mapbox js library so we can use its functionality -->
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.js'></script>
<!-- imports the styles (CSS) for the mapbox library -->
@wmandrews
wmandrews / index.html
Created November 4, 2013 15:21
Soundcite example
<link href='//cdn.knightlab.com/libs/soundcite/latest/css/player.css' rel='stylesheet' type='text/css'><script type='text/javascript' src='//connect.soundcloud.com/sdk.js'></script><script type='text/javascript' src='//cdn.knightlab.com/libs/soundcite/latest/js/soundcite.min.js'></script>
<p>Obama <span class="soundcite" data-id="66458753" data-start="0" data-end="10000">gave his speech</span> to hundreds of followers in Chicago after his victory.</p>
@wmandrews
wmandrews / gist:8723021
Created January 31, 2014 00:21
Require-ready SVG-Crowbar
require( [
'd3/3'
], function(d3) {
var doctype = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';
window.URL = (window.URL || window.webkitURL);
var script = document.createElement('script');
script.onload = initialize;