Skip to content

Instantly share code, notes, and snippets.

View theodore-s-beers's full-sized avatar
🐢
Making slow progress

Theo Beers theodore-s-beers

🐢
Making slow progress
View GitHub Profile
@johnelliott
johnelliott / uuidv4test.js
Last active June 4, 2024 18:02
uuid v4 regex
import { v4 as uuid } from 'uuid';
export function generateId() {
return uuid();
}
const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i);
console.log(generateId().match(v4));
//console.log(generateId().length)
@kevcjones-archived
kevcjones-archived / howto-unlock-pdf
Last active June 20, 2022 02:19
Unlocking a PDF using ghostscript
required - install ghost script - e.g brew install ghostscript (takes a few minutes)
update this line as needed and run in terminal
-- New and updated thanks to comments --
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -SPDFPassword=THE_PASSWORD -sOutputFile=unencrypted.pdf -c .setpdfwrite -f 2017-06-13-11-55-56-188_14972345156188_XXXPT6345X_ITRV.pdf
-- Original --
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf