Skip to content

Instantly share code, notes, and snippets.

@SamWhited
SamWhited / fonts.sh
Created August 6, 2013 04:27
Some oneliners for manipulating fonts in TeXLive
# List fonts on the system
fc-list | cut -d ':' -f 2 | sort | uniq | sed 's/^\s*//g'
# Get name of all fonts in current directory
find -name '*.[to]tf' -exec otfinfo --family \{\} \; | sort | uniq
@SamWhited
SamWhited / StJamesInfirmary.ly
Last active December 25, 2015 02:49
Lilypond example
\version "2.16.2"
tuba = \relative c {
% Clef, key, midi instrument, etc. is set here
\clef bass
\key aes \major
\time 2/2
% The music...
R1*4 \bar "||:" \break
@SamWhited
SamWhited / Makefile
Last active November 17, 2019 19:30
Makefile for sheet music with LilyPond and LaTeX
SHELL = /bin/sh
.SUFFIXES:
.SILENT:
.PHONY: timidity clean
# If you want more output, change this.
REDIRECT = > /dev/null
SHEETMUSICDIR = Songs
AOBSHEETMUSICDIR = AOB/Songs
DRAFTSHEETMUSICDIR = Drafts/Songs
@SamWhited
SamWhited / README.md
Last active August 29, 2015 13:58
A simple server that accepts HTTP post requests

This is a simple server example that accepts geojson features as POST requests (fair warning, it does no validation to make sure anything is geojson conformant) and spits out a geojson file with all the features wrapped in a feature array.

This is just an example. It does lots of bad things (like reading / writing the entire file every time it gets a post request) and is easily abused. The authentication isn't exactly secure either. By default it listens on :2230.

@SamWhited
SamWhited / spec.md
Last active August 29, 2015 14:05
API spec for a simple, universal commenting system

Simple comments API 1.0.0-draft01

Copyright

This work is licensed under a [Creative Commons Attribution 4.0 International License][ccby].

Introduction

@SamWhited
SamWhited / lincolnletter.tex
Created October 14, 2014 14:14
Open letter to the city council of Lincoln
\documentclass{letter}
\signature{Sam Whited}
\address{Atlanta, GA}
\begin{document}
\begin{letter}{Lincoln Town Office \\ PO Box 25 \\ Lincoln, NH 03251}
\opening{To whom it may concern:}
@SamWhited
SamWhited / rendermontage.sh
Created October 20, 2014 18:40
Script to render a montage of many images with an overlay
#!/bin/sh
#
# Requires: ImageMagick
# Usage:
# rendermontage.sh thumbsize overlayimage outputimage
#
montage -geometry $1x$1>+0+0 *.{jpeg,jpg,png} $3
composite -gravity center -background none $2 $3 $3
@SamWhited
SamWhited / pubkeys.md
Last active July 18, 2017 02:16
Public Keys [NO LONGER UP TO DATE]

This gist is deprecated; some of the keys may still be used, but the fingerprints are no longer mirrored to two or more locations for verification.

PGP

9761 51DE E472 01CE 4A85 9F70 5408 3AE1 04EA 7AD3

Verification methods

@SamWhited
SamWhited / TimePreference.java
Created December 17, 2014 00:10
Time picker preference for Android
import android.content.Context;
import android.content.res.TypedArray;
import android.preference.DialogPreference;
import android.preference.Preference;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TimePicker;
import java.text.DateFormat;
import java.util.Calendar;
@SamWhited
SamWhited / gist:aaf1ff4353de9f06a502
Created December 18, 2014 18:37
Test ejabberd SSL ciphers with openssl
#!/bin/bash
CIPHERS=`grep ^s2s_ciphers /etc/ejabberd/ejabberd.yml | cut -d\" -f2 | sed 's,:,\n,g'`
for CIPHER in $CIPHERS; do
echo "Testing: ${CIPHER}..."
openssl s_client -connect samwhited.com:5269 -starttls xmpp -cipher ${CIPHER} || echo "Fail"
done