Skip to content

Instantly share code, notes, and snippets.

@PaperNick
PaperNick / README.md
Last active November 18, 2023 21:20
Faster Whisper transcribe script
@PaperNick
PaperNick / windows_safe_renamer.py
Created July 8, 2023 14:44
Rename all files and directories - Safe for Windows
from pathlib import Path
special_chars = ('<', '>', ':', '"', '/', '\\', '|', '?', '*', '/')
def replace_all(text, items):
for i in items:
text = text.replace(i, '')
return text
@PaperNick
PaperNick / README.md
Last active July 19, 2024 08:06
Whisper.ccp transcription helper
@PaperNick
PaperNick / auth0-verify.js
Last active August 17, 2022 19:21 — forked from westmark/auth0-verify.js
Auth0 JWT Verification
/**
* The MIT License (MIT)
* Copyright (c) 2022 PaperNick
*
* Resouces used:
* https://github.com/auth0/node-jwks-rsa
* https://github.com/auth0/node-jsonwebtoken
* https://auth0.com/blog/navigating-rs256-and-jwks/
* https://gist.github.com/westmark/faee223e05bcbab433bfd4ed8e36fb5f
* https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/
#!/bin/bash
# Function taken from https://gist.github.com/cdown/1163649
# Install "urlencode" command from the "gridsite-clients" package if it doesn't work
urlencode() {
# Usage: urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
@PaperNick
PaperNick / README.md
Created December 4, 2020 15:12
CEZ breakdowns

Dependencies

Setup

mkdir cez_checker
cd cez_checker/
npm init --yes
@PaperNick
PaperNick / disallow-commits-in-branches.md
Created September 28, 2019 19:41
Git commit hook - disallow commit in specific branches

How to install

#!/bin/bash

current_branch="$(git symbolic-ref --short HEAD)"

FORBIDDEN_BRANCHES=(master develop)
for forbidden_branch in "${FORBIDDEN_BRANCHES[@]}"; do
 if [ "$current_branch" == "$forbidden_branch" ]; then
@PaperNick
PaperNick / django_choices_enum.py
Last active April 8, 2019 13:44 — forked from treyhunner/choice_enum.py
Enum for use with Django ChoiceField
from enum import Enum, EnumMeta, IntEnum, unique
def not_callable_in_template(cls):
"""Disable the callable behavior of Enum in django templates"""
cls.do_not_call_in_templates = True
return cls
class ChoiceEnumMeta(EnumMeta):