Skip to content

Instantly share code, notes, and snippets.

@FND
FND / app.js
Last active July 25, 2022 15:49
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 December 20, 2021 13:17
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 November 9, 2020 10:43
stateful HTTP client (Node)
View .gitignore
/node_modules
@FND
FND / webdav
Last active January 23, 2021 09:23
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 July 21, 2020 12:43
faucet-typescript sample
View .gitignore
/node_modules
/package-lock.json
/dist
@FND
FND / .gitignore
Last active May 30, 2020 09:10
bundling jQuery plugins with faucet-pipeline
View .gitignore
/node_modules
/package-lock.json
/dist
@FND
FND / README.md
Created April 21, 2020 18:56
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 March 18, 2020 05:52
JavaScript in Ruby
@FND
FND / .gitignore
Last active February 6, 2020 06:56
minimal complate sample
View .gitignore
/node_modules
/dist
@FND
FND / README.md
Last active January 15, 2020 16:55
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