This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Configuration - default prompt path | |
PROMPT_PATH=~/prompts | |
# Override with environment variable if set | |
[ -n "$PROMPT_PATH" ] && PROMPT_PATH="$PROMPT_PATH" | |
usage() { | |
echo "Usage: $(basename "$0") [-h] [prompt_name] [view]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 🎯 Self-documenting Makefile template | |
# This Makefile provides a central place for project scripts and tasks | |
# Run `make` or `make help` to see available commands | |
# ANSI color codes for pretty output | |
RED=\033[0;31m | |
GREEN=\033[0;32m | |
BLUE=\033[0;34m | |
NC=\033[0m # No Color |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Component extends HTMLElement { | |
render() {} | |
connectedCallback() { | |
this.attachShadow({ mode: 'open' }); | |
this.render(); | |
} | |
attributeChangedCallback(name, _, newValue) { | |
if (this.state && this.state[name] !== undefined) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget \ | |
--recursive \ | |
--no-clobber \ | |
--page-requisites \ | |
--html-extension \ | |
--span-hosts \ | |
--convert-links \ | |
--restrict-file-names=windows \ | |
--domains website.com,assets.website.com \ | |
--no-parent \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AnimationLoop { | |
constructor({ update, render, panic, tickRate = 30, autoPause = true }) { | |
this.update = update | |
this.render = render | |
this.panic = panic ?? (() => this.delta = 0) | |
this.frameID = null | |
this.lastFrameMs = 0 | |
this.lastFpsMs = 0 | |
this.frameCount = 0 | |
this.fps = 60 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const operations = { | |
'+': { | |
precedence: 1, | |
handler: (x, y) => x + y, | |
}, | |
'-': { | |
precedence: 1, | |
handler: (x, y) => x - y, | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const make_regexp = function(str, fl) { | |
return new RegExp(str.replace(/\s/g, ''), fl) | |
} | |
const rx_number = make_regexp(`^(?: | |
0 (?: | |
b [01]+ | |
| o [0-7]+ | |
| x [0-9 A-F]+ | |
| \\. [0-9]+ (?: e [+\\-]? [0-9]+ )? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Frazier's Object Modeling Language (FOML) | |
* | |
* FOML is a superset of JSON with... | |
* 1. Bash style comments | |
* 2. Root object curley braces are optional (each FOML document describes a single object) | |
* 3. End of line commas are optional, trailing commas are allowed | |
* 4. Colon (:) and equal (=) are interchangeable | |
* 5. Colon/equal is optional for object and array assignment | |
* 6. Simple property names do not require quotes (alphanumeric and _-.$@ characters only) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
main() { | |
return print(fib(10)) | |
} | |
fib(n) { | |
if (n == 0) { | |
return 0 | |
} else if (n == 1) { | |
return 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
expression = term {('+' | '-') term} | |
term = factor {('*' | '/') factor} | |
factor = base ['^' factor] | |
base = ['-'] value | |
value = number | '(' expression ')' | |
number = integer ['.' fractional] | |
integer = '0' | onenine {digit} | |
fractional = digit {digit} | |
onenine = digit - '0' |
NewerOlder