Skip to content

Instantly share code, notes, and snippets.

@rgcoe
rgcoe / bib2txt.sh
Created January 26, 2026 16:08
Entire BibTex to text (or other format) citations
#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<'EOF'
Usage:
bib2txt.sh <references.bib> [-o output.ext] [-c style.csl|url] [-T "Title"] [-h]
Defaults:
@rgcoe
rgcoe / movtogif.sh
Last active April 8, 2025 20:28
movtogif
movtogif () {
tempfile=.mov-to-gif-$(date +"%s").png
ffmpeg -v quiet -stats -y -i $1 -vf fps=5,palettegen $tempfile
ffmpeg -v quiet -stats -i $1 -i $tempfile -filter_complex "fps=12.5,scale=720:-1,paletteuse" "${1%.mov}.gif"
rm $tempfile
}
@rgcoe
rgcoe / compresspdf.sh
Last active January 17, 2026 14:44
compresspdf
#!/bin/bash
# Function to display help information
help() {
echo "Usage: $0 in_file out_file [screen|ebook|printer]"
echo
echo "Compress a PDF file using Ghostscript."
echo
echo "Arguments:"
echo " in_file The input PDF file to be compressed."
@rgcoe
rgcoe / blums.py
Created February 15, 2021 15:49
Blum's test for independence
def blums(x, y=None, sig_lev=0.01):
"""
Performs Blum's test for independence.
Blum, J. R., et al. “Distribution Free Tests of Independence Based on the
Sample Distribution Function.” The Annals of Mathematical Statistics, vol.
32, no. 2, 1961, pp. 485–498. JSTOR, www.jstor.org/stable/2237758.
Parameters
----------