Skip to content

Instantly share code, notes, and snippets.

@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
    
@FND
FND / ast_manipulation.js
Last active Sep 16, 2019
JavaScript AST manipulation
View ast_manipulation.js
#!/usr/bin/env node
let { generate } = require("escodegen");
let jsx = require("acorn-jsx");
let acorn = require("acorn");
let { strictEqual: assertSame } = require("assert");
let JSXParser = acorn.Parser.extend(jsx());
let ast = JSXParser.parse(`<Card title={123}>
@FND
FND / README.md
Last active Sep 16, 2019
(De-)Serializing JavaScript Models With Metaprogramming
View README.md

compare before.js with after.js