Skip to content

Instantly share code, notes, and snippets.

@SamWhited
SamWhited / syncMETAR.sh
Created November 17, 2012 18:54
Scripts I wrote to manage weather alerts and data
#!/bin/bash
# Used to sync METAR data for Airports I want updates from.
# All data can be fetched via FTP but that's a waste of bandwidth.
curl --silent "http://weather.noaa.gov/pub/data/observations/metar/stations/{KFTY,KATL}.TXT" -o "/var/www/weather.noaa.gov/pub/data/observations/metar/stations/#1.TXT"
(
this[key] = ->
return this.attrs[key]
) for key in this.attrs
@SamWhited
SamWhited / anteater.scss
Created August 18, 2012 22:04
Scripts and styles for Project Anteater
$page-width: 996px;
$column-width: 425px;
$grid-bottom: 59px;
$header-height: 150px;
$screen-border: 1em;
$background-color: #000;
$text-color: #ddd;
$social-icon-size: 50px;
$header-fonts: "raleway", sans-serif;
$body-fonts: "adobe-garamond-pro", Calluna, Georgia, serif;
@SamWhited
SamWhited / flac2ogg.sh
Last active October 8, 2015 04:48
Scripts I wrote to manage my music collection
#!/usr/bin/env bash
# Wrap FLAC files in an OGG wrapper (.oga file).
# Deletes the original flac file after verifying that the oga file matches.
# For safety all warnings are treated as errors (and prevent deletion of flac files).
#
# WARNING: Does not prompt before overwriting `.oga' files.
#
# Examples:
#
# $ flac2ogg flacfile.flac
@SamWhited
SamWhited / PorUnaCabeza.tex
Created August 5, 2012 23:48
Side-by-side translation of `Por Una Cabeza' by Carlos Gardel using poetrytex and paracol.
% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8
\documentclass[11pt]{article}
% Use UTF-8
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
% Use [PoetryTeX](http://www.ctan.org/pkg/poetrytex) and paracol.
@SamWhited
SamWhited / 0001-Remove-titlecase-from-blockquote.patch
Created August 5, 2012 03:29
Remove titlecase from Brandon Mathis' blockquote plugin
From 9b679e42b946eb140d2c57a7ec4afa6d42d1d097 Mon Sep 17 00:00:00 2001
From: Sam Whited <[email protected]>
Date: Sat, 4 Aug 2012 23:27:41 -0400
Subject: [PATCH] Remove titlecase from blockquote
---
plugins/blockquote.rb | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/plugins/blockquote.rb b/plugins/blockquote.rb
@SamWhited
SamWhited / gitparse.tex
Created July 16, 2012 02:07
Make LaTeX git-aware
% A few example commands for a more git-aware LaTeX.
% Note that this requires you to run pdflatex/xelatex/etc. with the
% `--shell-escape' option which is extremely unsafe. Use with care
% and *never* use with plain TeX.
% Print the short-hash of the current commit
\newcommand*{\gitrev}{%
\immediate\write18{%
rm gitrev.tex 2> /dev/null; git rev-parse --short HEAD > gitrev.tex
}%
@SamWhited
SamWhited / qc.sh
Created June 6, 2012 20:38
Downloads Questionable Content (http://questionablecontent.net/)
#!/usr/bin/env bash
for i in $(eval echo {$1..$2})
do
curl "http://questionablecontent.net/comics/$i.png" > "QuestionableContent/$i.png"
done
@SamWhited
SamWhited / LSJAP.tex
Created May 11, 2012 18:23
The Love Song of J. Alfred Prufrock by T.S. Eliot (1915)
% !TEX TS-program = xelatex
% !TEX encoding = UTF-8
\documentclass[a4paper,11pt]{article}
% Use [PoetryTeX](http://samwhited.github.com/poetrytex/).
\usepackage{poetrytex}
% Use the PA5 paper size
\usepackage[paperwidth=140mm,paperheight=210mm]{geometry}
@SamWhited
SamWhited / hyperref.tex
Created April 23, 2012 18:42
The proper options for the hyperref LaTeX package
% Because I can never remember how to get rid of the borders on all systems...
\usepackage[pdfborder=0, bookmarks, colorlinks=false]{hyperref}