Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View DavidAnson's full-sized avatar

David Anson DavidAnson

View GitHub Profile
@DavidAnson
DavidAnson / common-markdown-mistakes.md
Last active March 7, 2024 04:57
A few common Markdown mistakes

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 / example.md
Created February 6, 2024 19:51
mdl1123
DBMS SQL Injection
PostgreSQL `$$='$$=chr(61)
@DavidAnson
DavidAnson / notes.md
Created August 27, 2023 18:58
Why `npm-shrinkwrap.json` seems unusable

For historical purposes and possible future reference, here are my notes on why I backed out a change to use npm-shrinkwrap.json in markdownlint-cli2.

The basic problem is that npm will include platform-specific packages in npm-shrinkwrap.json. Specifically, if one generates npm-shrinkwrap.json on Mac, it may include components (like fsevents) that are only supported on Mac. Attempts to use a published package with such a npm-shrinkwrap.json on a different platform like Linux or Windows fails with EBADPLATFORM. This seems (to me, currently) like a fundamental and fatal flaw with the way npm implements npm-shrinkwrap.json. And while there are ways npm might address this problem, the current state of things seems unusably broken.

To make this concrete, the result of running rm npm-shrinkwrap.json && npm install && npm shrinkwrap for this project on macOS can be found here: . Note that fsevents is an optional M

<!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 / index.html
Last active August 29, 2015 14:19
Safari in iOS 8.3 crashes if the link is tapped when focus is in the text box
<!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 February 20, 2015 02:37
Qsequence, a simple sequencer for Q
"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 04:12
An IHttpModule that rewrites all URLs to /app.js (making the original URL available to the Node.js application).
// 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>