| description |
|---|
Initialize the Feature Design (FD) tracking system in any project |
Set up a lightweight feature tracking system in the current project. Creates directory structure, index, templates, slash commands, and CLAUDE.md conventions.
| function create-venv() { | |
| name=$(basename $PWD) | |
| venv_path="$HOME/.venvs/$name" | |
| if [ -d "$venv_path" ]; then | |
| echo "$venv_path already exists" | |
| return | |
| fi | |
| python3 -m venv "$venv_path" | |
| source "$venv_path/bin/activate" | |
| pip install --upgrade pip |
| " If we're using iterm2 (OS X), check if there's a colorscheme in vim matching the iterm2 profile name. | |
| " If the profile name has suffix " - light" then set bg=light else bg=dark. | |
| " If we're not using iterm2, based on the time of day, pick a colorscheme light (day) vs dark (night). | |
| " I like the yin and yang colorschemes for vim and iterm2: https://github.com/pgdouyon/yin-yang | |
| " So I have a profile in iterm2 named "yang - light" and "yin - dark". | |
| " Note: iterm2 does not _update_ the env var ITERM_PROFILE after _changing_ the profile, just on launch. | |
| " You'll have to `source ~/.vimrc` after changing the iterm2 profile or if not running vim, launch it. | |
| let itermprofile = system("osascript -e 'tell application \"iTerm2\"\nget profile name of current session of current window\nend tell'") | |
| try |
| import os | |
| import sys | |
| counts = dict() | |
| for root, dirs, files in os.walk(sys.argv[1]): | |
| for filename in files: | |
| full_path = os.path.join(root, filename) | |
| base, ext = os.path.splitext(full_path) | |
| if len(ext) == 0: |
| const express = require("express"); | |
| const app = express(); | |
| app.use((req, res, next) => { | |
| res.once("finish", () => { | |
| console.log("finish"); | |
| }); | |
| next(); | |
| }); | |
| app.get("/", (req, res) => { | |
| console.log("in get"); |
| // note: encoded data is NOT encrypted | |
| const crypto = require('crypto'); | |
| const secret = '20BBEBB8-DCC1-4544-AD32-7F3973CCED7A'; | |
| function createDigest(encodedData, format) { | |
| return crypto | |
| .createHmac('sha256', secret) | |
| .update(encodedData) | |
| .digest(format); |
| #!/bin/bash | |
| set -eu | |
| trap 'rm -f .all .used' 0 1 2 3 6 9 15 | |
| curl -s https://raw.githubusercontent.com/sindresorhus/builtin-modules/master/builtin-modules.json | jq -c '.[]' | sed -e 's/"//g' > .all | |
| ack --js -h "require\('([^']+)'" --output '$1' | egrep -v '^\.' | sort -u > .used | |
| npm i -S $(grep -Fvxf .all .used) |
| create or replace function time_diff_in_words( | |
| a timestamp with time zone, | |
| b timestamp with time zone | |
| ) returns text as $$ | |
| declare | |
| _age interval; | |
| _suffix text; | |
| _years integer; | |
| _months integer; | |
| _days integer; |
| extension Optional where Wrapped == String { | |
| var nilIfEmpty: String? { | |
| guard let strongSelf = self else { | |
| return nil | |
| } | |
| return strongSelf.isEmpty ? nil : strongSelf | |
| } | |
| } |
| var scene, camera, renderer; | |
| $(function () { | |
| renderer = new THREE.WebGLRenderer(); | |
| renderer.setPixelRatio(window.devicePixelRatio); | |
| renderer.setSize(window.innerWidth, window.innerHeight); | |
| renderer.shadowMapEnabled = true; | |
| document.body.appendChild(renderer.domElement); |