Skip to content

Instantly share code, notes, and snippets.

Avatar

Tab Atkins Jr. tabatkins

View GitHub Profile
@tabatkins
tabatkins / gist:9946593
Created Apr 3, 2014
Markdown BS: `<dl>` format
View gist:9946593

Similarly to Markdown ULs and OLs, the DL format is defined by grouping its items.

A DT is indicated by a line starting with a :. A DD is indicated by a line starting with a ::. As with UL/OL, you can linebreak within a block by indenting the subsequent lines, and a block can contain multiple paragraphs as long as you indent. Two blank lines, or a single blank line followed by an unindented line, ends the list.

:term
::definition
:another term
::a longer definition
    stretching over two lines
View keybase.md

Keybase proof

I hereby claim:

  • I am tabatkins on github.
  • I am tabatkins (https://keybase.io/tabatkins) on keybase.
  • I have a public key whose fingerprint is DC31 DBD2 B540 C41C 082C 94DF 873F 4A7E 14B4 98DE

To claim this, I am signing this object:

@tabatkins
tabatkins / gist:57d07e4b75a9fc66ee30
Last active Aug 29, 2015
List of Suggested Extensions to CSS
View gist:57d07e4b75a9fc66ee30

List of Suggested Extensions to CSS

This is a breakdown of "List of Suggested Extensions to CSS", produced by the CSSWG back in 1998. It goes through each feature and either lists where the feature has been defined in the intervening 16 years, or notes that it has yet to be addressed.

Out of the 67 suggested extensions, 30 have been added, 10 have been partially added or been added but with uncertain implementor interest, and 27 have not been added.

  1. Columns: http://dev.w3.org/csswg/css-multicol/
  2. Swash letters and other glyph substitutions: http://dev.w3.org/csswg/css-fonts/#font-rend-props
  3. ~ Running headers and footers: http://dev.w3.org/csswg/css-gcpm/#running-elements, but unproven so
@tabatkins
tabatkins / gist:8c0cb8043dbb2787d59a
Created Oct 22, 2014
All strings [a-z]+ of length N or less, in lexicographic order
View gist:8c0cb8043dbb2787d59a
function gen(N) {
var strings = [];
var max = Math.pow(36, N);
for(var i = 10; i < max; i++) {
var candidate = i.toString(36);
if(/^[a-z]+$/.test(candidate)) {
strings.push(candidate);
}
}
return strings;
@tabatkins
tabatkins / gist:b9b07594dbcde338fd86
Last active Aug 29, 2015
Comparing two linking syntaxes
View gist:b9b07594dbcde338fd86
[
{
"linkingText": "blob",
"url": "http://dev.w3.org/2006/webapi/FileAPI/#blob",
"type": "dfn"
},
{
"linkingText": "blob url store",
"url": "http://dev.w3.org/2006/webapi/FileAPI/#BlobURLStore",
"type": "dfn"
View gist:6a5f74fc50d8e16e2d39
CookieBot = {
$bigCookie: null,
$products: null,
running: true,
init: function() {
CookieBot.$bigCookie = document.querySelector("#bigCookie");
CookieBot.$products = [].slice.call(document.querySelectorAll(".product"));
},
View SpecRef edits
{
"css-animations-1": {
"aliasOf": "css3-animations"
},
"css-backgrounds-3": {
"aliasOf": "css3-background"
},
"css-box-3": {
"aliasOf": "css3-box"
},
View RGBAtoHSLA.js
function RGBAtoHSLA(r, g, b, a) {
var
min = Math.min(r, g, b),
max = Math.max(r, g, b),
diff = max - min,
hsla = [0, 0, (min + max) / 2, a];
if (diff != 0) {
hsla[1] = hsla[2] < 0.5 ? diff / (max + min) : diff / (2 - max - min);
View find_your_nearest.php
<?php
/**
*
* ----------------------------------------------
* HTML to JSON
* ----------------------------------------------
*
* [Currently used in Wordpress to output HTML into a Google Maps InfoWindow correctly]
*
@tabatkins
tabatkins / jsonplist.py
Last active Dec 20, 2015
Tiny library/command-line-program for converting between json and plist formats. I use it for editing SublimeText setting files.
View jsonplist.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import plistlib
import json
import StringIO
# Takes as input a string of either JSON or Plist.
# Returns the opposite, assuming no errors.
def convert(input):