Skip to content

Instantly share code, notes, and snippets.

@afontenot
afontenot / fix-signal.sh
Created July 17, 2025 06:57
Replace the emoji used in Signal Desktop (on Linux) with Noto emoji
#!/usr/bin/bash
set -euo pipefail
tempdir=$(mktemp --directory)
pushd "$tempdir"
npx asar extract /usr/lib/signal-desktop/resources/app.asar signal
curl -JORL 'https://raw.githubusercontent.com/iamcal/emoji-data/refs/heads/master/sheet_google_32.png'
curl -JORL 'https://raw.githubusercontent.com/iamcal/emoji-data/refs/heads/master/sheet_google_64.png'
cwebp -progress -mt -preset icon -alpha_filter best -alpha_q 20 -pass 10 -q 75 sheet_google_32.png -o emoji-sheet-32.webp
@afontenot
afontenot / bbul.user.js
Last active March 19, 2025 19:33
User script to show Fediverse links for bridged users on their Bluesky profiles
// ==UserScript==
// @name Bluesky Bridged User Labeler
// @match https://bsky.app/*
// @version 1.6.1
// ==/UserScript==
// Link to your Fediverse instance (use "{handle}" as a template)
const FEDI_URL = "https://mastodon.social/@{handle}@bsky.brid.gy";
// Globals
@afontenot
afontenot / mastodon-replace-emoji.css
Last active July 17, 2025 07:15
A CSS snippet to replace the hardcoded Twitter emoji on Mastodon with the local font
/*
==UserCSS==
@name Mastodon - change emoji in emoji picker
@match https://mastodon.social/*
@version 1.1.1
==/UserCSS==
*/
/* NOTES:
*
@afontenot
afontenot / election_night_live_model.R
Created October 31, 2020 22:25 — forked from elliottmorris/election_night_live_model.R
A live election-night prediction model using The Economist's pre-election forecast
#' Description
#' This file runs a live election-night forecast based on The Economist's pre-election forecasting model
#' available at projects.economist.com/us-2020-forecast/president.
#' It is resampling model based on https://pkremp.github.io/update_prob.html.
#' This script does not input any real election results! You will have to enter your picks/constraints manually (scroll to the bottom of the script).
#'
#' Licence
#' This software is published by *[The Economist](https://www.economist.com)* under the [MIT licence](https://opensource.org/licenses/MIT). The data generated by *The Economist* are available under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/).
#' The licences include only the data and the software authored by *The Economist*, and do not cover any *Economist* content or third-party data or content made available using the software. More information about licensing, syndication and the copyright of *Economist* content can be fou
/* ==UserStyle==
@name Github redesign fixes
@namespace github.com/openstyles/stylus
@version 1.5.5
@description Fixes various issues with Github's redesign
@author afontenot/LunarTwilight
@preprocessor less
@var color background "Readme header background color" #f1f8ff
@var color border "Readme header border color" #e6e4e4
@var text padding "Amount of padding used on the header" 18vw
@afontenot
afontenot / sd.py
Created March 31, 2020 01:30
snippet reproducing a bug in shapely's polylabel function
import cartopy.crs as ccrs
import cartopy.io.shapereader as shpreader
import matplotlib.pyplot as plt
from shapely.ops import polylabel
shapename="admin_1_states_provinces_lakes_shp"
states_shp = shpreader.natural_earth(
resolution='50m',
category='cultural',
name=shapename