Skip to content

Instantly share code, notes, and snippets.

View beastaugh's full-sized avatar

Benedict Eastaugh beastaugh

View GitHub Profile
@beastaugh
beastaugh / php_configure_flags.txt
Created September 30, 2010 20:36
PHP 5.3.3 configure flags
./configure \
--enable-fpm \
--enable-soap \
--with-mcrypt \
--enable-mbstring \
--with-openssl \
--with-mysql \
--with-mysql-sock \
--with-pgsql \
--without-sqlite \
@beastaugh
beastaugh / html5video.html
Created September 8, 2010 14:07
HTML5 video, falling back to Flowplayer
<div id="video-1-container" class="video">
<video id="video-1" src="video/html5.mp4" width="480" height="204" controls>
<!-- HTML5 video, for compatible browsers -->
</video>
</div>
<script type="text/javascript">
Ojay.onDOMReady(function() {
// The video and the container need separate IDs to work around IE6's
// unwillingness to locate video elements.
@beastaugh
beastaugh / fix_font_smoothing.css
Created August 22, 2010 23:27
Fed up with websites screwing up your font smoothing? Reset it!
* {-webkit-font-smoothing:inherit!important;}
@beastaugh
beastaugh / typeclassopedia.hs
Created July 28, 2010 13:29
Playing around with some stuff from the Typeclassopedia
module Main where
main = putStr ""
-- The above just so I can runghc typeclassopedia.hs
--
-- The Typeclassopedia can be found in The Monad.Reader Issue 13
-- http://www.haskell.org/sitewiki/images/8/85/TMR-Issue13.pdf
instance Functor (Either e) where
@beastaugh
beastaugh / tsp.rb
Created July 26, 2010 15:12
Generate 1x1 PNG files with a particular background colour and opacity
#!/usr/bin/env ruby
require 'oyster'
spec = Oyster.spec do
name "tsp -- Generate 1x1 PNG files with a particular background colour and opacity"
description <<-EOS
tsp is a command-line utility for generating 1x1 pixel PNG files with a given
background colour and opacity. Due to the relative lack of support for RGBA
amongst web browsers, it's useful to be able to generate background images
From ec4ee0a508c3b4573b805cafda8c8f35388f9ffc Mon Sep 17 00:00:00 2001
From: Benedict Eastaugh <benedict@eastaugh.net>
Date: Sat, 24 Jul 2010 15:43:57 +0100
Subject: [PATCH] Just generating a patch so I can hack on stuff.
---
src/firmin.js | 115 +++++++++++++++++++++++++++++++++++++++++-----
test/3d-transforms.html | 109 ++++++++++++++++++++++++++++++++++++++++++++
test/index.html | 1 +
3 files changed, 212 insertions(+), 13 deletions(-)
@beastaugh
beastaugh / unfoldr.js
Created July 22, 2010 13:35
An implementation of Haskell's Data.List.unfoldr function in JavaScript
// An implementation of Haskell's Data.List.unfoldr in JavaScript.
function unfoldr(step, seed) {
var output = [], result;
while (result = step(seed)) {
output.push(result[0]);
seed = result[1];
}
return output;
@beastaugh
beastaugh / partition.hs
Created July 15, 2010 10:28
Partition a list into sublists of length n in various languages.
-- | The 'partition' function splits a list into sublists of length n.
partition :: Int -> [a] -> [[a]]
partition n = unfoldr step
where
step :: [a] -> Maybe ([a], [a])
step [] = Nothing
step xs = Just (take n xs, drop n xs)
@beastaugh
beastaugh / Run.tmCommand
Created May 17, 2010 00:54
Run JavaScript from TextMate
#!/usr/bin/env node
var nodeTM = require('/path/to/node_tm');
nodeTM.run([process.ENV.TM_FILEPATH]);
@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