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 | |
#Scientific programming deals with arrays of numbers. | |
#Here's a quick snippet showing how Ruby behaves with arrays. | |
strike_dip = [ [ 12.0, 30.0 ], | |
[ 43.0, 12.0 ]] | |
puts "Whole array" | |
puts strike_dip |
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 | |
# This is what I'm using to process a directory full | |
# of kramdown (~markdown) files. | |
# | |
# Copyright 2010 David M. Doolin ([email protected]) | |
# | |
# License: Public domain. | |
# And a little transclusion demo... |
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
#include <stdio.h> | |
#include <string.h> | |
int | |
main(int argc, char ** argv) { | |
while (argc--) { | |
printf("Arg %d: %s, strlen: %lu\n",argc, argv[argc], strlen(argv[argc])); | |
} |
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
/** Add this to Thesis custom_functions.php */ | |
if (file_exists(THESIS_CUSTOM . '/tinobox_footer.php')) { | |
include(THESIS_CUSTOM . '/tinobox_footer.php'); | |
remove_action('thesis_hook_footer','thesis_attribution'); | |
add_action('thesis_hook_footer','tinobox_footer'); | |
} |
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
div.doolin { | |
position: fixed; | |
bottom: 5px; | |
right: 5px; | |
} |
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
class Person < ActiveRecord::Base | |
validates :first_name, :presence => true | |
validates :last_name, :presence => true | |
end |
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/sh | |
# This script will overwrite an existing | |
# WordPress installation with the current | |
# head of trunk. Once it has been reverted, | |
# you may need to update the database, and | |
# WP will prompt you for that automatically. | |
# This is untested with these options! | |
# The script commands work from the command |
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
# Put this in your functions.php file | |
if (file_exists(TEMPLATEPATH . '/art.php')) { | |
include(TEMPLATEPATH . '/art.php'); | |
} |
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: Demo Plugin TinyMCE | |
Plugin URI: http://website-in-a-weekend.net/demo-plugins/ | |
Description: A brief description of the Plugin. | |
Version: 0.1 | |
Author: Dave Doolin | |
Author URI: http://website-in-a-weekend.net/ | |
*/ |
OlderNewer