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
@MarkTiedemann
MarkTiedemann / README.md
Last active Sep 7, 2019
Poor Man's CGI with Node
View README.md

Poor Man's CGI with Node

$ chmod +x script.sh
$ node server.js &
$ curl localhost -d hello
<!DOCTYPE html>
<pre>
POST / HTTP/1.1
Host: localhost
View no_cms.js
let http = require("http")
let html = String.raw
let cms = {
title: "My Title",
text: "My text"
}
function site(editable) {
let edit = editable ? ` contenteditable="true"` : ""
View git-notes.sh
# Based on:
# https://web.archive.org/web/20180121193320/http://git-scm.com/blog/2010/08/25/notes.html
# - Pushing notes
git push origin "refs/notes/*"
# - Fetching notes
git fetch origin "refs/notes/*:refs/notes/*"
View typer.html
<!DOCTYPE html>
<span>for </span><span id="typer"></span>
<script>
var target = document.getElementById("typer");
var texts = [
["developers", ""],
["beginners", "🔥"],
["unicorns", "🦄"],
["hackers", "💀"],
View svg_star.html
<body style="display: flex; flex-direction: row; justify-content: center; margin: 0;">
<svg style="width: 100vh; height: 100vh;" viewBox="0 0 210 210" preserveAspectRatio="none">
<polygon points="100,10 40,190 190,80 10,80 160,190" style="fill: orange; fill-rule: nonzero;" />
</svg>
</body>
View 1709_x64.Dockerfile
FROM microsoft/nanoserver:1709
ADD https://nodejs.org/dist/v10.12.0/win-x64/node.exe C:/Windows/system32/node.exe
COPY prebuilt/addon_x64.node addon_x64.node
View sys_init.cmd
@echo off
set log=C:\sys_init.log
:isAdmin
net sessions > nul 2>&1
if %errorlevel% equ 0 goto stopDiskMonitor
:runAsAdmin
powershell ^
View parse.js
function Grammar(rules) {
this.rules = rules
}
function Rule(lhs, rhs) {
this.lhs = lhs
this.rhs = rhs
}
function parse(input) {
@MarkTiedemann
MarkTiedemann / index.html
Last active Jul 2, 2018
Poor Man's Live-Reload Client And Server
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script>
var source = new EventSource('/')
source.onmessage = () => {
source.close()
location.reload()
View dotnet-sql-client-benchmark-03-08-18.log
[INFO] Invoking bench 'bench1' with image 'bench:latest' (15:19:14)
Running 30s test @ http://app1:5000/sync
20 connections
Stat Avg Stdev Max
Latency (ms) 9.95 26.1 1996.68
Req/Sec 1911.84 275.3 2427
Bytes/Sec 176 kB 25.6 kB 223 kB
Percentile Latency (ms)
You can’t perform that action at this time.