Fastpack - pack JavaScript fast & easy
This gist is a submission for a lightning talk on the ReactiveConf 2018.
- JavaScript bundling can be a lot faster
- There are proper tools to guarantee consistency
- Writing OCaml code is fun!
# ----------------------------------------------------------------------------- | |
# AI-powered Git Commit Function | |
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It: | |
# 1) gets the current staged changed diff | |
# 2) sends them to an LLM to write the git commit message | |
# 3) allows you to easily accept, edit, regenerate, cancel | |
# But - just read and edit the code however you like | |
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/ | |
gcm() { |
This gist is a submission for a lightning talk on the ReactiveConf 2018.
#!/bin/bash | |
# Invoke like this: | |
# ./watch.sh my command here | |
# And it will run 'my command here' once, and then when it detects changes. | |
# TODO: Don't just search in the last second. Search for updates since the last | |
# completed build. Otherwise for big directories, midway through your search | |
# you've already taken 1s and you will miss updates. |
let cache = new Map(); | |
let pending = new Map(); | |
function fetchTextSync(url) { | |
if (cache.has(url)) { | |
return cache.get(url); | |
} | |
if (pending.has(url)) { | |
throw pending.get(url); | |
} |
'use strict'; | |
module.exports = function CustomError(message, extra) { | |
Error.captureStackTrace(this, this.constructor); | |
this.name = this.constructor.name; | |
this.message = message; | |
this.extra = extra; | |
}; | |
require('util').inherits(module.exports, Error); |