Skip to content

Instantly share code, notes, and snippets.

View SamWhited's full-sized avatar

Sam Whited SamWhited

View GitHub Profile
@SamWhited
SamWhited / links.md
Created April 20, 2012 21:41
Strange pages on SamWhited.com
@SamWhited
SamWhited / email.md
Created March 20, 2012 21:54
My email in a fun, spam-bot-defeating, format.

This is my email:

echo sam.samwhited.com | sed 's/\./@/'

Also this:

echo sam.samwhited.com | awk '{sub(/\./,"@")}; 1'
@SamWhited
SamWhited / if-news-snippet
Created March 9, 2012 00:07
Radiant snippet for inserting content on pages whose path contains a date (Archive page)
<r:hide>
Insert content only if we're viewing a news item.
Matches any path that contains "/news/yyyy/mm/dd/"
</r:hide>
<r:if_path matches="\/news\/(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])\/" ignore_case="true">
<r:yield />
</r:if_path>
@SamWhited
SamWhited / get_test.sh
Created March 6, 2012 20:29
Continuously make requests to a server with curl and measure the request frequency with pv
#!/usr/sbin/env bash
while true; do
curl $1 -s > /dev/null
echo .
done | pv -l > /dev/null
@SamWhited
SamWhited / flatten_list.coffee
Created March 6, 2012 04:49
Simple list flattening
(i for i in s for s in l)
@SamWhited
SamWhited / popdown.css
Created March 6, 2012 02:59
Make an octocat pop-down on mouse over (like https://samwhited.com/projects)
.parent {
overflow: hidden;
}
.popdown {
position: absolute;
top: -60px;
right: 2em;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
@SamWhited
SamWhited / modern.scss
Created March 5, 2012 09:39
The Radiant CMS template being used on SamWhited.com
$accent: #9BBB59;
$accent-darker: #577715;
$background: #FFFFFF;
$header-color: #222222;
$body-fonts: Verdana, Tahoma, Geneva, sans-serif;
$header-fonts: Georgia, "Times New Roman", serif;
$title-fonts: museo-1, museo-2, $header-fonts;
$monospace-fonts: Consolas, "Bitstream Vera Sans Mono", "Lucida Console", "Courier New", monospace;
$shadow-basic: 0px 1px 0px white;
$page-color: #321E1E;
@SamWhited
SamWhited / DoverBeach.tex
Created March 1, 2012 05:57
Dover Beach by Matthew Arnold (1867)
% !TEX TS-program = xelatex
% !TEX encoding = UTF-8
\documentclass[11pt]{article}
% Use [PoetryTeX](http://samwhited.github.com/poetrytex/).
\usepackage{poetrytex}
% Use the PA5 paper size
\usepackage[paperwidth=140mm,paperheight=210mm]{geometry}
@SamWhited
SamWhited / highwayman.tex
Created March 1, 2012 05:48
The Highwayman by Alfred Noyes (1906)
% !TEX TS-program = xelatex
% !TEX encoding = UTF-8
\documentclass[11pt]{article}
% Use [PoetryTeX](http://samwhited.github.com/poetrytex/).
\usepackage{poetrytex}
% Use the PA5 paper size
\usepackage[paperwidth=140mm,paperheight=210mm]{geometry}
@SamWhited
SamWhited / LadyOfShalott.tex
Created March 1, 2012 05:25
The Lady of Shalott by Lord Tennyson (1842)
% !TEX TS-program = xelatex
% !TEX encoding = UTF-8
\documentclass[11pt]{article}
% Use [PoetryTeX](http://samwhited.github.com/poetrytex/).
\usepackage{poetrytex}
% Use the PA5 paper size
\usepackage[paperwidth=140mm,paperheight=210mm]{geometry}