Skip to content

Instantly share code, notes, and snippets.

View beastaugh's full-sized avatar

Benedict Eastaugh beastaugh

View GitHub Profile
@beastaugh
beastaugh / custom_header_resize.php
Created March 26, 2009 11:19
Plugin to change your WordPress theme's custom header size
<?php
/*
Plugin Name: Custom Header Resize
Plugin URI: http://tarskitheme.com/
Description: Change your theme's custom header size.
Author: Benedict Eastaugh
Version: 1.0
Author URI: http://extralogical.net/
*/
@beastaugh
beastaugh / fib.js
Created September 30, 2009 13:52
Calculate Fibonacci numbers in JavaScript
/**
* The Fibonacci numbers in JavaScript.
*
* A cached solution with O(1) lookup for previously-calculated terms and O(N)
* lookup for uncalculated ones.
*
* Because numbers in JavaScript are 64bit, the largest available number is
* 1.7976931348623157e+308. The 1476th term is the last that can be calculated.
* If a later term is requested, the function will return Infinity.
*
@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",
@beastaugh
beastaugh / FizzBuzz.hs
Created January 24, 2009 02:09
FizzBuzz in Haskell; won't win any Code Golf competitions
module Main (main) where
main :: IO ()
main = putStr . unlines . take 100 $ fizzBuzz
fizzBuzz :: [String]
fizzBuzz = map (either show id . fizzes) [1..]
fizzes :: Int -> Either Int String
fizzes n | 15 `divides` n = Right "FizzBuzz"
@beastaugh
beastaugh / CRecFile.php
Created April 10, 2010 15:13
Manages a Company of Heroes .REC (replay) file
<?php
/*
This file was written by Corsix, no copyright is claimed.
The file is in the public domain; do with it what you wish.
Updated November 16th 2006: Updated documentation and example code, patch 1.3 support, bugfixes
10 April 2010 - Benneb: Made script compatible with COH patch 2.601
*/
// Manages a Company of Heroes .REC (replay) file
@beastaugh
beastaugh / hidden_comment_form.php
Created October 3, 2009 12:15
Plugin to hide the WordPress comment form until the user clicks a link to reveal it.
<?php
/*
Plugin Name: Hidden Comment Form
Plugin URI: http://tarskitheme.com/help/hooks/example-plugins/
Description: Hide the comment form until the user clicks a link to reveal it.
Author: Benedict Eastaugh
Version: 1.1
Author URI: http://extralogical.net/
*/
@beastaugh
beastaugh / hide_authors_tarski.php
Created April 15, 2013 14:50
WordPress plugin to hide post and page author names in the Tarski theme.
<?php
/*
Plugin Name: Hide Author Names in Tarski
Plugin URI: http://tarskitheme.com/help/hooks/example-plugins/
Description: Hide post and page author names in the Tarski theme.
Author: Benedict Eastaugh
Version: 1.0
Author URI: http://extralogical.net/
*/
@beastaugh
beastaugh / hatt-parser2.hs
Created December 3, 2012 00:33
New parser for Hatt with support for associativity and operator precedence
module Data.Logic.Propositional.Parser2 where
import Data.Logic.Propositional
import Text.Parsec.Prim ((<|>), (<?>), runPT)
import Text.Parsec.Char (char, letter, spaces, string)
import Text.Parsec.Expr
parseExpr' = runPT expr ()
@beastaugh
beastaugh / move_comment_link.php
Created September 29, 2011 14:57
WordPress plugin to move Tarski's comments link from the post metadata to the end of the post.
@beastaugh
beastaugh / gist:1204509
Created September 8, 2011 20:02
What is the weakest system that proves Dedekind's categoricity theorem for second-order arithmetic?

Q. What is the weakest system that proves Dedekind's categoricity theorem for second-order arithmetic?

In his classic essay 'Was sind und was sollen die Zahlen?', Dedekind proved the categoricity of the second-order Peano axioms, i.e. that all simply infinite systems---in modern terminology, models of those axioms---are isomorphic to one another. This proof was carried out in Dedekind's informal system of set theory.

Feferman and Hellman (1995) carried out a proof of this result in their system EFSC, the "Elementary theory of Finite Sets and Classes". This system has an