Skip to content

Instantly share code, notes, and snippets.

Mark Tiedemann MarkTiedemann

Block or report user

Report or block MarkTiedemann

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View little_endian.js
let isLittleEndian = new Uint8Array(new Uint16Array([0x1234]).buffer)[0] === 0x34;
MarkTiedemann / cdc.ts
Last active Jan 27, 2020
Latest 10-minute air temperatures for Hamburg-Neuwiedenthal by Climate Data Center Germany
View cdc.ts
// Usage: deno --allow-net cdc.ts
import "";
import { parse } from "";
import { BufReader } from "";
async function main() {
// For a list of stations, see:
View dwd.js
const fs = require("fs");
const https = require("https");
const jsdom = require("jsdom");
const unzipper = require("unzipper");
function main() {
// To get an overview, see:
MarkTiedemann / index.html
Last active Jan 10, 2020
Single Sentence DOMParser, XSLTProcessor, and XMLSerializer Tutorial
View index.html
<!DOCTYPE html>
<title>Single Sentence DOMParser, XSLTProcessor, and XMLSerializer Tutorial</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
html {
font-family: Arial;
background: #20202a;
color: white;
margin: 0 1em;
padding-bottom: 2em;
MarkTiedemann / Makefile
Created Dec 13, 2019
View Makefile
.PHONY: clean
-rm *.tested
MarkTiedemann / Makefile
Created Dec 13, 2019
View Makefile
.PHONY: test
test: good.tested bad.tested
good.tested: ndjson_validator.js good.ndjson
node ndjson_validator.js < good.ndjson
touch good.tested
bad.tested: ndjson_validator.js bad.ndjson
! node ndjson_validator.js < bad.ndjson
touch bad.tested
MarkTiedemann / Makefile
Created Dec 13, 2019
View Makefile
.PHONY: test
node ndjson_validator.js < good.ndjson
! node ndjson_validator.js < bad.ndjson
MarkTiedemann / bad.ndjson
Created Dec 13, 2019
View bad.ndjson
This is invalid NDJSON.
MarkTiedemann / good.ndjson
Created Dec 13, 2019
View good.ndjson
[ "This", "is", "valid", "NDJSON." ]
MarkTiedemann / ndjson_validator.js
Created Dec 13, 2019
View ndjson_validator.js
// Usage: node ndjson_validator.js < file
.on("line", line => {
try { JSON.parse(line) }
catch { process.exit(1) }
You can’t perform that action at this time.