Skip to content

Instantly share code, notes, and snippets.

@FND
FND / app.js
Last active Jul 25, 2022
simplistic router with web standards
View app.js
import { Router } from "./router.js";
let router = new Router([
["/blog/:article", makeHandler("BLOG")],
["/blog/:article/:comment", makeHandler("COMMENT")],
["/api/*", makeHandler("API")]
]);
let uris = [
"/foo",
@FND
FND / index.html
Last active Dec 20, 2021
encryption/decryption
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Encryption/Decryption</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
*,
*::before,
@FND
FND / .gitignore
Last active Nov 9, 2020
stateful HTTP client (Node)
View .gitignore
/node_modules
@FND
FND / webdav
Last active Jan 23, 2021
minimal WebDAV implementation for TiddlyWiki
View webdav
#!/usr/bin/env python3
import os
from hashlib import md5
ROOT_DIR = os.path.dirname(__file__)
STATUSES = {
200: "OK",
@FND
FND / .gitignore
Created Jul 21, 2020
faucet-typescript sample
View .gitignore
/node_modules
/package-lock.json
/dist
@FND
FND / .gitignore
Last active May 30, 2020
bundling jQuery plugins with faucet-pipeline
View .gitignore
/node_modules
/package-lock.json
/dist
@FND
FND / README.md
Created Apr 21, 2020
static vs. dynamic ESM imports
View README.md
$ mkdir -p node_modules/my-lib
$ cp package.json node_modules/my-lib/
$ mv my_lib.js node_modules/my-lib/index.js

$ node index_static.js
$ node index_dynamic.js
@FND
FND / .gitignore
Last active Mar 18, 2020
JavaScript in Ruby
@FND
FND / .gitignore
Last active Feb 6, 2020
minimal complate sample
View .gitignore
/node_modules
/dist
@FND
FND / README.md
Last active Jan 15, 2020
test case for resolving implicit package names
View README.md

test case for resolving implicit package names

  1. npm install

  2. ./test should emit something like the following:

    project directory: /home/dev
    moving to /tmp
    

resolved: /tmp/node_modules/material-design-icons/index.js