Skip to content

Instantly share code, notes, and snippets.

Avatar

David Anson DavidAnson

View GitHub Profile
@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>
@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 / 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>
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 / Page.html
Created May 24, 2022
Cloudflare HTTP 200 response to linkinator fetch of https://opensource.org/licenses/MIT
View Page.html
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Just a moment...</title>
<style>
html, body {width: 100%; height: 100%; margin: 0; padding: 0;}
body {background-color: #ffffff; color: #000000; font-family:-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Helvetica Neue",Arial, sans-serif; font-size: 16px; line-height: 1.7em;-webkit-font-smoothing: antialiased;}
@DavidAnson
DavidAnson / common-markdown-mistakes.md
Last active Jun 8, 2022
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: