Skip to content

Instantly share code, notes, and snippets.

@JanMiksovsky
JanMiksovsky / 1_before.html
Last active October 16, 2024 18:22
Demonstration of whitespace normalization in Origami 0.0.70
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="/assets/styles.css" />
<link rel="alternate" type="application/rss+xml" title="Dispatches from off the grid" href="feed.xml">
<link rel="alternate" type="application/json" title="Dispatches from off the grid" href="feed.json">
<title>Solitude</title>
</head>
(text) => `<p>${ text }</p>`
title template
Cool document
coolPage.ori

This document is so cool that it specifies its own template.

@JanMiksovsky
JanMiksovsky / .htaccess
Last active September 19, 2024 01:23
Apache/PHP implementation of the JSON Keys protocol
# Enable the RewriteEngine
RewriteEngine On
# Match requests for .keys.json at any directory level, including the root
RewriteRule ^(.*)/?\.keys\.json$ /keys.php?dir=$1 [L]
@JanMiksovsky
JanMiksovsky / README.md
Created August 19, 2024 17:48
Sample gist with multiple files

This is the Read Me file.

@JanMiksovsky
JanMiksovsky / greet.ts
Last active August 28, 2024 23:26
Sample TypeScript project
export default function greet(name: string) {
return `Hello, ${name}!`;
}
@JanMiksovsky
JanMiksovsky / launch.json
Created July 12, 2024 21:56
VS Code launch configuration to run the "start" script when you select Start Debugging
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
// This configuration tells VS Code to launch the project via `npm start`.
"type": "node",
"request": "launch",
@JanMiksovsky
JanMiksovsky / writeFileString.js
Created June 27, 2024 21:46
Measure difference in performance of writeFile(string value) vs writeFile(String object)
import fs from "node:fs/promises";
// Create a 1MB string value to a file
const string = "a".repeat(1000000);
const startValue = performance.mark("string");
await fs.writeFile("1MB.txt", string);
const measureValue = performance.measure("write string value", startValue);
console.log(`${measureValue.name}: ${measureValue.duration}ms`);
// Write the string as a String object
@JanMiksovsky
JanMiksovsky / tenHundredWords.txt
Last active January 22, 2023 18:24
The list of 10 Hundred words from Randall Monrole's book "Thing Explainer" (https://xkcd.com/thing-explainer), verified against the list provided at the back of the book
a
able
about
above
accept
across
act
actually
add
admit
@JanMiksovsky
JanMiksovsky / index.html = this().ori
Last active October 18, 2022 23:20
A trivial site using data and templates
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Reviews</title>
<link rel="stylesheet" href="main.css" />
</head>
<body>
<h1>Reviews</h1>
<div class="cards">