This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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/ | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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/ | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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/ | |
*/ | |