Skip to content

Instantly share code, notes, and snippets.

@m1guelpf
Forked from Philogy/headers.py
Last active October 9, 2022 05:18
Show Gist options
  • Save m1guelpf/64b6117d81b3e65a67dbacb69f3e2796 to your computer and use it in GitHub Desktop.
Save m1guelpf/64b6117d81b3e65a67dbacb69f3e2796 to your computer and use it in GitHub Desktop.
Transmission11s Style Headers In Node
#!/usr/bin/env node
import { execSync } from 'child_process'
const args = process.argv.slice(2);
if (args.length !== 1) {
throw new Error(`Invalid argument count ${args.length} expected 1`);
}
const word = args[0];
const header = ` /*//////////////////////////////////////////////////////////////
${' '.repeat((64 - word.length) / 2)}${word.toUpperCase()}
//////////////////////////////////////////////////////////////*/`;
console.log(header);
execSync(`echo "${header}" | pbcopy`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment