Skip to content

Instantly share code, notes, and snippets.

View wouter-veeken's full-sized avatar

Wouter Veeken wouter-veeken

View GitHub Profile
@wouter-veeken
wouter-veeken / pomo.sh
Last active March 26, 2024 10:01
Super lightweight pomodoro timer script, modified for Mac from https://github.com/sayanarijit/pomo. Just copy/paste into your `.bashrc` or equivalent.
# pomodoro timer (pomo <minutes> <message>)
function pomo() {
arg1=$1
shift
args="$*"
min=${arg1:?Example: pomo 15 Take a break}
sec=$((min * 60))
msg="${args:?Example: pomo 15 Take a break}"
@wouter-veeken
wouter-veeken / lint-openapi-with-vale.js
Last active March 1, 2024 08:34
Node JS script that accepts a swagger.json URL passed on the command line, extracts human-readable descriptions, and passes them to Vale for grammar/style checks. Requires: Node, Vale. DISCLAIMER: ChatGPT wrote most of this for me, with a fair amount of tweaking and iteration, and it works to my satisfaction. Approach with a healthy degree of sk…
// $ node lint-openapi-with-vale.js https://link-to-my/swagger.json
const axios = require('axios');
const { exec } = require('child_process');
async function fetchSwaggerJson(remoteUrl) {
try {
const response = await axios.get(remoteUrl);
return response.data;
} catch (error) {