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 'date' | |
class Date | |
if RUBY_VERSION < '1.9' | |
## accept 1.9 marshaled data on 1.8 | |
## based on ext/date/date_core.c d_lite_marshal_dump_old | |
def marshal_load(data) | |
nth, jd, df, sf, of, @sg = data | |
real_jd = |
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 sh | |
if ! which md5sum > /dev/null; then | |
echo Install md5sum | |
exit 1 | |
fi | |
if ! which curl > /dev/null; then | |
echo Install curl | |
exit 1 |
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
<html> | |
<head> | |
<title>Simple Sparkline using SVG Path and d3.js</title> | |
<script src="http://mbostock.github.com/d3/d3.v2.js"></script> | |
<style> | |
/* tell the SVG path to be a thin blue line without any area fill */ | |
path { | |
stroke: steelblue; | |
stroke-width: 1; | |
fill: none; |
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
These little programs read a spelt (EDIT: it is not "spoken") number from the | |
standard input and write the corresponding number to the standard output. Weigh | |
just 243 bytes and 227 bytes of C. (EDIT: was originally 256 and 240 bytes.) | |
The longer version handles numbers up to 999,999,999,999,999, that is, just | |
shy of 1,000 trillions. The shorter version handles numbers up to 19,999,999, | |
or 999,999,999 if your "int" is 64 bits long. The input should be correct, | |
although it will handle "a" and "and" correctly and ignore some invalid | |
words. |
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 "rubygems" | |
require "selenium-webdriver" | |
$DEBUG = true | |
profile = Selenium::WebDriver::Firefox::Profile.new | |
profile.log_file = File.expand_path("firefox.log") | |
profile.log_file.gsub!("/", "\\") if Selenium::WebDriver::Platform.windows? | |
begin |
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
# Set postgis-1.5 path. | |
$ POSTGIS_SQL_PATH=`pg_config --sharedir`/contrib/postgis-1.5 | |
# Creating the template spatial database | |
$ createdb -E UTF8 -T template0 template_postgis | |
# and add PLPGSQL language support. | |
$ createlang -d template_postgis plpgsql | |
# Loading the PostGIS SQL routines. | |
$ psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql |
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
# Ensure AssetTagHelper has been loaded before we try to monkey-patch it. | |
require 'action_view/helpers/asset_tag_helper' | |
module ActionView::Helpers::AssetTagHelper | |
# Insert the asset id in the filename, rather than in the query string. In | |
# addition to looking nicer, this also keeps any other static file handlers | |
# from preempting our Rack::StaticCache middleware, since these | |
# version-numbered files don't actually exist on disk. | |
def rewrite_asset_path(source) | |
source.insert source.rindex('.'), "-#{rails_asset_id(source)}" |