Skip to content

Instantly share code, notes, and snippets.

View SamWhited's full-sized avatar

Sam Whited SamWhited

View GitHub Profile
@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 / 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 / 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 / post_commit_btproof.sh
Last active December 17, 2015 21:38
Send a small ammount of money via bitcoin after making a git commit so that the blockchain can be used to verify the time at which the commit was made (https://www.btproof.com/)
#!/bin/bash
# What this does:
#
# This is an untested (I have no idea what the syntax is for bitcoind, so this probably doesn't actually work;
# it's just an idea) post-commit hook for sending a bitcoin transaction. This allows one to use the bitcoin
# blockchain for trusted timestamping of git commits. This might be useful if you expect a bogus copyright claim,
# or want to make sure you have proof that you started a project before working for a company or going to a school
# that likes to seize intellectual property from their employees and claim it was developed on their dime.
#
@SamWhited
SamWhited / gist:5335415
Created April 8, 2013 09:09
Build error in coin3d
Making all in fonts
make[4]: Entering directory `/home/sam/Downloads/coin/src/Coin-3.1.3/src/fonts'
/bin/sh ../../libtool --mode=compile g++ -DHAVE_CONFIG_H -I../../include -I../../include -I../../src -I../../src -D_FORTIFY_SOURCE=2 -D_REENTRANT -DNDEBUG -DCOIN_DEBUG=0 -DCOIN_INTERNAL -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -W -Wall -Wno-unused -Wno-multichar -Woverloaded-virtual -c -o freetype.lo freetype.cpp
g++ -DHAVE_CONFIG_H -I../../include -I../../include -I../../src -I../../src -D_FORTIFY_SOURCE=2 -D_REENTRANT -DNDEBUG -DCOIN_DEBUG=0 -DCOIN_INTERNAL -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -W -Wall -Wno-unused -Wno-multichar -Woverloaded-virtual -c freetype.cpp -fPIC -DPIC -o .libs/freetype.o
In file included from ../../src/base/dict.h:31:0,
from freetype.cpp:142:
/usr/include/c++/4.8.0/cstdlib: In function 'long long int std::abs(long long int)':
/usr/include/c++/4.8.0/cstdlib:174:20: error: de
@SamWhited
SamWhited / codescompiling.tex
Last active December 13, 2015 20:48
Code's Compiling, a duple becket contra dance by Sam Whited
\documentclass[a7paper]{contracard}
\begin{document}
\begin{contra}{Code's Compiling}{Sam Whited}{Duple becket}
\move[8]{Neighbor dosido}
\move[8]{Partner see saw}
\move{Shadow swing}
\move[8]{Balance and petronella}
\move[8]{Balance and petronella}
\move[8]{Partner swing}
From 9046e5a23499218f14d84a1d555abda1cf1c1c66 Mon Sep 17 00:00:00 2001
From: Sam Whited <sam@samwhited.com>
Date: Fri, 8 Feb 2013 09:33:26 -0500
Subject: [PATCH] Remove deprecated rake/gempackagetask
---
lib/tasks/release.rake | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/tasks/release.rake b/lib/tasks/release.rake
@SamWhited
SamWhited / gitignore.vim
Last active December 11, 2015 23:08
Parse a .gitignore file in vim
" Load a .gitignore file from the current directory
" and parse it for use in Vim
let gitignore = '.gitignore'
if filereadable(gitignore)
let igstring = ''
for oline in readfile(gitignore)
let line = substitute(oline, '\s|\n|\r', '', "g")
if line =~ '^#' | con | endif
if line == '' | con | endif
@SamWhited
SamWhited / .gitignore
Last active December 10, 2015 14:28
My standard .gitignore file (compilation of files from https://github.com/github/gitignore)
.*
!.gitignore
*~
.*.s[a-w][a-z]
*.un~
Session.vim
.netrwhist
# Emacs
@SamWhited
SamWhited / bep_00XX.rst
Last active December 10, 2015 06:18
A potential BEP candidate for the Bittorrent standards track
BEP: XX
Title: DNS Tracker Lookup with FQDNs
Version: $Revision$
Last-Modified: $Date$
Author: Sam Whited <sam@samwhited.com>
Status: Draft
Type: Standards Track
Created: 27-December-2012
Post-History: