Skip to content

Instantly share code, notes, and snippets.

View beastaugh's full-sized avatar

Benedict Eastaugh beastaugh

View GitHub Profile
routeArticle :: Routes
routeArticle = customRoute (flip replaceExtension ".html" . dropDate)
dropDate :: Identifier -> FilePath
dropDate ident = let file = toFilePath ident
in replaceFileName file (drop 11 $ takeFileName file)
@beastaugh
beastaugh / functions.php
Created April 3, 2011 13:14
A full-width version of the Tarski theme.
<?php
function my_theme_init() {
if (!is_admin()) {
wp_enqueue_style('tarski_stylesheet', get_template_directory_uri() . '/style.css');
}
}
add_action('init', 'my_theme_init');
-- Render RSS feed
route "rss.xml" $ idRoute
create "rss.xml" $
requireAll_ "posts/*"
>>> mapCompiler (arr $ copyField "body" "description")
>>> renderRss feedConfiguration
@beastaugh
beastaugh / gist:888519
Created March 26, 2011 18:35
Stupid case-insensitive file system :/
~/projects/hakyll/examples/brochure (examples) $ ll
total 32
-rw-r--r-- 1 ionfish staff 724B 27 Sep 18:57 about.rst
-rw-r--r-- 1 ionfish staff 794B 27 Sep 18:57 code.lhs
drwxr-xr-x 4 ionfish staff 136B 15 Nov 15:25 css
-rw-r--r--@ 1 ionfish staff 504B 26 Mar 18:32 hakyll.hs
-rw-r--r--@ 1 ionfish staff 1.1K 27 Sep 18:57 index.markdown
drwxr-xr-x 3 ionfish staff 102B 19 Mar 12:13 templates
~/projects/hakyll/examples/brochure (examples) $ ghc --make hakyll.hs
> (((P | Q) & ~(P & Q)) & R)
P Q R | (((P | Q) & ~(P & Q)) & R)
----------------------------------
T T T | F
T T F | F
T F T | T
T F F | F
F T T | T
F T F | F
F F T | F
@beastaugh
beastaugh / brew_install_rabbitmq.log
Created January 22, 2011 18:38
Console output when installing RabbitMQ with Homebrew.
~ $ brew install rabbitmq
/usr/local/homebrew/bin/git
==> Cloning git://github.com/erlang/otp.git
Cloning into /Users/ionfish/Library/Caches/Homebrew/erlang--git...
remote: Counting objects: 32164, done.
remote: Compressing objects: 100% (11497/11497), done.
remote: Total 32164 (delta 22466), reused 28916 (delta 20028)
Receiving objects: 100% (32164/32164), 34.69 MiB | 1.62 MiB/s, done.
Resolving deltas: 100% (22466/22466), done.
==> Checking out tag OTP_R14B01
Prelude> :l time.hs
[1 of 1] Compiling Main ( time.hs, interpreted )
Ok, modules loaded: Main.
*Main> (Time 0) == 0
True
@beastaugh
beastaugh / bookmarklet
Created December 2, 2010 14:17
Remove any viewport meta elements
javascript:(function(){var b=document.getElementsByTagName('meta'),c=b.length,a;while(c--){a=b[c];if(a.name.toLowerCase()=='viewport'){a.parentNode.removeChild(a)}}})();
@beastaugh
beastaugh / type-theory.bib
Created November 26, 2010 15:20
Type theory bibliography
@book { girard1989,
author = "Jean-Yves Girard and Yves Lafont and Paul Taylor",
title = "Proofs and Types",
publisher = "Cambridge University Press",
year = "1989",
isbn = "978-0521371810" }
@book { barendregt1984
author = "Henrik P. Barendregt",
title = "The Lambda Calculus: Its Syntax and Semantics",
{-# LANGUAGE OverloadedStrings #-}
module Data.Set.Naive
( empty
, member
, subset
, properSubset
, superset
, properSuperset
, powerset
, showSet