Skip to content

Instantly share code, notes, and snippets.

@MTuner
MTuner / fix-sublimetext-subpixel.txt
Last active March 31, 2023 21:44
Fixing font rendering/aliasing in Sublime Text in MacOS Mojave
Apple removed colored sub-pixel antialiasing in MacOS Mojave
(https://developer.apple.com/videos/play/wwdc2018/209/ starting from ~28min)
To make fonts look normal in Sublime Text, add to Preferences:
// For the editor
"font_options": [ "gray_antialias" ],
// For the sidebar / other elements
"theme_font_options": [ "gray_antialias" ],
@PatrickKalkman
PatrickKalkman / secrets.js
Created February 2, 2020 18:40
Reading secrets from the file system
// dependencies
const fs = require('fs');
const log = require('../log');
const dockerSecret = {};
dockerSecret.read = function read(secretNameAndPath) {
try {
return fs.readFileSync(`${secretNameAndPath}`, 'utf8');
} catch(err) {
@Eskuero
Eskuero / synapse-tidying.py
Last active August 26, 2023 20:33
Tidying up a bit database and remote media from a synapse server using the admin API
#!/usr/bin/python
import requests
import time
import sys
import json
# Login and get a token
endpoint = "https://fromshado.ws"
# Admin credentials
ADMINUSER = ""
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 4, 2024 04:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]