Skip to content

Instantly share code, notes, and snippets.

Avatar

David Anson DavidAnson

View GitHub Profile
View CssPropertyNameOverlapWithHexColors.html
<!DOCTYPE html>
<html>
<head>
<title>CSS property names having longest overlap with hexadecimal color characters</title>
</head>
<body>
<pre><script>
r = []
for (s in getComputedStyle(document.body)) {
s = s.toLowerCase()
@DavidAnson
DavidAnson / common-markdown-mistakes.md
Last active Dec 3, 2020
A few common Markdown mistakes
View common-markdown-mistakes.md

The following snippets show some common Markdown mistakes.

Click the Raw button to see the source text and understand the author's intent.

GitHub's parser handles some of these cases; other parsers do not.

To catch these problems automatically:

@DavidAnson
DavidAnson / index.html
Last active Aug 29, 2015
Safari in iOS 8.3 crashes if the link is tapped when focus is in the text box
View index.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="initial-scale=1, user-scalable=no"/>
<title>iOS 8.3 Safari Crash</title>
</head>
<body>
<p>Safari in iOS 8.3 crashes if the link is tapped when focus is in the text box:</p>
<p><input type="text" placeholder="1. Tap to focus"/></p>
@DavidAnson
DavidAnson / Qsequence.js
Created Feb 20, 2015
Qsequence, a simple sequencer for Q
View Qsequence.js
"use strict";
var Q = require("q");
// Worker function
function logAndIncrement(val) {
console.log(val);
return val + 1;
}
@DavidAnson
DavidAnson / IisNodeUrlRewriter.cs
Created May 2, 2014
An IHttpModule that rewrites all URLs to /app.js (making the original URL available to the Node.js application).
View IisNodeUrlRewriter.cs
// Copyright (c) 2014 by David Anson, http://dlaa.me/
// Released under the MIT license, http://opensource.org/licenses/MIT
using System;
using System.Text.RegularExpressions;
using System.Web;
/// <summary>
/// An IHttpModule that rewrites all URLs to /app.js (making the original URL available to the Node.js application).
/// </summary>