Skip to content

Instantly share code, notes, and snippets.

View adactio's full-sized avatar

Jeremy Keith adactio

View GitHub Profile
<?php
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/
$labels = array(
"What’s on your mind?",
"Hey Joe, what do you know?",
"Speak your brains",
"Share what you know",
@adactio
adactio / datalist.html
Created January 9, 2011 17:24
Progressive enhancement with datalist
<!DOCTYPE html>
<title>Datalist test</title>
<meta charset="utf-8">
<form>
<label for="source">How did you hear about us?</label>
<datalist id="sources">
<select name="source">
<option>please choose...</option>
<option value="television">Television</option>
<option value="radio">Radio</option>
@adactio
adactio / flexboxtest.html
Created August 15, 2011 22:46
Content-first flexbox test
<!DOCTYPE html>
<html>
<head>
<title>Flexbox test</title>
<style>
@media screen and (min-width: 30em) {
body {
display: -webkit-box;
display: -moz-box;
display: -ms-box;
@adactio
adactio / monthform.html
Created December 13, 2011 22:20
An experiment with a progressive enhancement pattern to replace two select with a single year-month field.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Input test</title>
</head>
<body>
<form method="post" action="#">
@adactio
adactio / placeholderFromDatalist.js
Created August 12, 2012 15:54
Generate a placeholder attribute from the datalist associated with that input.
(function(win,doc) {
if (doc.querySelectorAll) {
var inputs = doc.querySelectorAll('input[list]'),
total = inputs.length;
for (var i=0; i<total; i++) {
var input = inputs[i],
id = input.getAttribute('list'),
list = doc.getElementById(id),
options = list.getElementsByTagName('option'),
amount = options.length,
<?php
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/
function postToFlickr($data=array()) {
$api_key = 'XXX';
$api_secret = 'XXXX';
$auth_token = 'XXXX';
@adactio
adactio / oEmbed.php
Last active November 7, 2015 10:22
<?php
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/
function getEmbedCode($url="",$maxwidth=320) {
$return = '';
$providers = array(
@adactio
adactio / Look ahead pre-parser test
Last active December 19, 2015 15:09
I'd like to know if browsers that have a "look ahead" pre-parser for images will start downloading foo.png ...even if they support svg.
<!DOCTYPE html>
<title>Test</title>
<object data="foo.svg" type="image/svg+xml">
<img src="foo.png">
</object>
@adactio
adactio / urtext.html
Last active May 7, 2016 02:06
December 3rd, 1990: The earliest known HTML document: http://www.w3.org/2012/08/history-of-the-web/origins.htm
<h1>Standardisation</h1>
There was not a lot of discussion of this at <a href=Introduction.html>ECHT90</a>, but there seem to be two leads:
<ol>
<li><a href=People.html#newcombe>Steve newcombe's</a> and Goldfarber's "Hytime" committee
looking into SGML, and
<li>An ISO working group known as MHEG, "Multimedia/HyperText Expert Group".
led by one Francis Kretz (Thompsa SA? Rennes?).
</lo>
@adactio
adactio / tabledisplaytest.html
Created August 16, 2011 10:36
Content-first table-display test
<!DOCTYPE html>
<html>
<head>
<title>Table Display test</title>
<style>
@media screen and (min-width: 30em) {
body {
display: table;
caption-side: top;
}