Skip to content

Instantly share code, notes, and snippets.

View beastaugh's full-sized avatar

Benedict Eastaugh beastaugh

View GitHub Profile
@beastaugh
beastaugh / always_show_authors.php
Created December 11, 2008 12:41
Always show author names on posts in Tarski.
<?php
/*
Plugin Name: Always Show Authors
Plugin URI: http://tarskitheme.com/
Description: Always show author names on posts in Tarski.
Author: Ben Eastaugh
Version: 1.0
Author URI: http://extralogical.net/
*/
@beastaugh
beastaugh / remove_post_navigation.php
Created December 30, 2008 22:52
Remove next & previous post navigation.
<?php
/*
Plugin Name: Remove Post Navigation
Plugin URI: http://tarskitheme.com/
Description: Remove next & previous post navigation.
Author: Benedict Eastaugh
Version: 1.0
Author URI: http://extralogical.net/
*/
(define (factorial n)
(define (iter product counter)
(if (> counter n)
product
(iter (* product counter)
(+ counter 1))))
(iter 1 1))
;Approximates e by taking the first n terms of the series.
(define (e-approx n)
@beastaugh
beastaugh / classy_pages.php
Created January 10, 2009 00:37
Add a class of 'page' to the body element on WordPress pages.
<?php
/*
Plugin Name: Classy Pages
Plugin URI: http://tarskitheme.com/
Description: Add a class of <code>page</code> to the <code>body</code> element on pages.
Author: Benedict Eastaugh
Version: 1.0
Author URI: http://extralogical.net/
*/
@beastaugh
beastaugh / sidebarless_pages.php
Created January 13, 2009 16:47
Remove Tarski's sidebar from pages.
<?php
/*
Plugin Name: Sidebarless Pages
Plugin URI: http://tarskitheme.com/
Description: Remove Tarski's sidebar from pages.
Author: Benedict Eastaugh
Version: 1.0
Author URI: http://extralogical.net/
*/
<?php
/*
Plugin Name: Unlinked Posts
Plugin URI: http://tarskitheme.com/
Description: Hide the next & previous posts navigation in Tarski.
Author: Benedict Eastaugh
Version: 1.0
Author URI: http://extralogical.net/
*/
@beastaugh
beastaugh / wp_update.rb
Created January 16, 2009 00:51
WordPress upgrade script
#!/usr/bin/env ruby
require 'pathname'
CRUFT = %w{index.php license.txt readme.html wp-content/plugins/hello.php}
SITES = %w{tarskitheme.com extralogical.net}.map do |path|
Pathname.new(ENV['HOME']) + "public_html" + path + "public/wp"
end
SITES.each do |site|
@beastaugh
beastaugh / rm_navbar.php
Created February 14, 2009 20:17
Remove Tarski's navbar.
<?php
/*
Plugin Name: Remove Navbar
Plugin URI: http://tarskitheme.com/
Description: Remove Tarski's navbar.
Author: Benedict Eastaugh
Version: 1.0
Author URI: http://extralogical.net/
*/
@beastaugh
beastaugh / rgb_to_hsl.rb
Created March 5, 2009 15:31
An RGB to HSL colour coverter
require 'mathn'
require 'rational'
def rgb_to_hsl(red, green, blue)
red, green, blue = rgb = [red, green, blue].map {|i| Rational(i, 255) }
max, min = rgb.max, rgb.min
huer = lambda {|num, a| 60 * (num / (max - min)) + a }
lightness = (max + min) / 2
@beastaugh
beastaugh / category_styles.php
Created March 14, 2009 12:49
Per-category stylesheets plugin for WordPress
<?php
/*
Plugin Name: Category Stylesheets
Plugin URI: http://extralogical.net/projects/
Description: Apply category-specific stylesheets to posts and archives.
Author: Ben Eastaugh
Version: 1.0
Author URI: http://extralogical.net/
*/