Skip to content

Instantly share code, notes, and snippets.

View AnthonyWharton's full-sized avatar

Anthony Wharton AnthonyWharton

View GitHub Profile
@AnthonyWharton
AnthonyWharton / footnote.tex
Created April 22, 2019 14:48
Simple yet more useful footnotes in LaTeX
% Define macros to handle footnotes better
% Usage: \fnm will mark footnotes, and then \fnt{foobar} will populate footnote
% with "foobar".
% Note: \fnt{} order will evaluate in a 1-to-1 correspondence with ordering of
% \fnm usage.
% Credit: https://tex.stackexchange.com/a/437538/121389
\newcounter{footnotemarknum}
\newcommand{\fnm}{\addtocounter{footnotemarknum}{1}\footnotemark{}}
\newcommand{\fnt}[1]{
@AnthonyWharton
AnthonyWharton / automatedManualCertbotRenewal.sh
Last active July 28, 2024 15:24
FreeDNS (afraid.org) Cerbot/Let's Encrypt Manual Automation Script
#!/bin/bash
# Copyright 2018, Anthony Wharton
# Single script that can be called that generates certificates using the
# certbotFreeDNSAuthHook.sh and certbotFreeDNSCleanupHook.sh scripts.
# This should be used as guidence of my usage, and changed to your needs. Note
# the generic `/path/to/...` and `DOMAIN.COM`, which should be replaced with
# your script location and domain respectively. In addition, for this to be
# used on a live system, one must remove the `--dry-run` flag.
@AnthonyWharton
AnthonyWharton / firefox-desktop-fix.sh
Created September 5, 2018 14:28
Firefox Desktop Theme Fix
#!/bin/bash
# Quick and dirty script to patch the firefox desktop file to always use a
# white GTK theme as to not break website appearances. Does a crude check to
# ensure that it doesn't apply the patch twice.
if [[ "$EUID" -ne 0 ]]; then
echo "This fix requires root, please allow for root privileges."
echo "Gaining root privilege for file fix.. "
gksu $0 &> /dev/null
exit $?
@AnthonyWharton
AnthonyWharton / Preferences.kt
Created June 25, 2018 17:03
A more "secure", obfuscating wrapper for Android's SharedPreferences
// Copyright 2018 Anthony Wharton
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@AnthonyWharton
AnthonyWharton / create-blank.py
Created December 19, 2017 21:46
Makes a blank template for week-daily markdown notes.
#!/bin/python3
import os.path
import inquirer
from calendar import monthrange
from datetime import datetime