Skip to content

Instantly share code, notes, and snippets.

View glowinthedark's full-sized avatar

glowinthedark glowinthedark

  • URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
  • HTTPError: HTTP Error 403: Forbidden
View GitHub Profile
glowinthedark /
Last active June 6, 2024 11:14
Text translation with facebook/nllb-200-3.3B model
#!/usr/bin/env python3
# Dependencies
# =============================
# pip install nltk transformers
import argparse
import sys
from pathlib import Path
glowinthedark / RsyncBackup.js
Last active May 30, 2024 12:03
MacOS RsyncBackup — simplest possible rsync GUI for MacOS
#!/usr/bin/osascript -l JavaScript
// The SHEBANG is only needed if the file is executable and is run from a terminal with `./RsyncBackup.js`
// 1. In MacOS Spotlight type 'Script Editor' and paste the code below
// 2. Click the top-left dropdown which says 'AppleScript' and select 'JavaScript'
// 3. Under menu File pick Export
// 4. In the Export dialog select File Format = Application
// 5. Save the app in /Applications
glowinthedark /
Last active May 11, 2024 06:45
Convert Lingvo DSL, Babylon BGL, Stardict, ZIM, etc dictionaries to MDict MDX (see formats supported by
# Convert Lingvo DSL, Babylon BGL, Stardict, ZIM, etc dictionaries to MDict MDX (see input formats supported by
# Dependencies:
# python3, sqlite3, pyglossary, mdict-utils
# optional dependency: dictzip (for unpacking .dz files)
# Install all dependencies with:
# pip3 install pyglossary mdict-utils lxml polib PyYAML beautifulsoup4 html5lib PyICU libzim>=1.0 python-lzo prompt_toolkit
glowinthedark /
Last active May 7, 2024 01:41
Python simple PDF viewer using PyQt5 and mozilla's pdf.js
#!/usr/bin/env python3
import sys
from pathlib import Path
from PyQt5.QtCore import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtWidgets import *
glowinthedark /
Last active March 15, 2024 12:30
Script to generate a static HTML image gallery file with thumbnail generation using imagemagick and keyboard navigation; support for images, audio, video
glowinthedark /
Last active February 16, 2024 21:58
Generate directory index (recurse subfolders with `-r` or `--recursive`). Use `-h` or `--help` for all options ❗️superseded by
#!/usr/bin/env python3
# NOTE: this script is deprecated;
# maintained version with SVG icons:
# ---
# Copyright 2020 glowinthedark
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
glowinthedark /
Last active February 14, 2024 20:32
Script to generate a static HTML image gallery file with thubnails generation using imagemagick
We couldn’t find that file to show.
glowinthedark /
Last active February 11, 2024 17:34
Script to generate a static HTML image gallery file
glowinthedark / json_remove_null_keys.js
Created February 10, 2024 09:44
remove empty or null keys from JSON file; print to stdout or to file with `-o output.json`; to beautify output JSON add the `-f` flag
#!/usr/bin/env node
const fs = require('fs');
// Function to remove null keys from an object
function removeEmpty(obj) {
Object.keys(obj).forEach(function(key) {
if (obj[key] && typeof obj[key] === 'object') {
} else if (obj[key] === '' || obj[key] === null) {