This file contains hidden or 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
% ruby --version | |
ruby 1.8.6 (2007-09-23 patchlevel 110) [i686-darwin9.0.0] | |
% sudo gem install rails --version 2.1.1 | |
Password: | |
Successfully installed activesupport-2.1.1 | |
Successfully installed activerecord-2.1.1 | |
Successfully installed actionpack-2.1.1 | |
Successfully installed actionmailer-2.1.1 | |
Successfully installed activeresource-2.1.1 |
This file contains hidden or 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>Table Test</title> | |
<style type="text/css" media="screen"> | |
table { table-layout: fixed; width: 100%; border-collapse: collapse; border-spacing: 0; } | |
td { padding: 5px; border: 1px solid #888888; } |
This file contains hidden or 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
Why is http://gist.github.com/15704 invalid HTML? | |
The width of each column is specified as 50%. Section 10.2 of the CSS2 spec tells us: | |
The percentage is calculated with respect to the width of the generated box's containing block. | |
The containing block in this case is the table. So let's say the table is, for example, 500px wide. | |
That means each column is 250px wide, but... | |
Section 17.6.2 tells us that the row width is: |
This file contains hidden or 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
value = "Don T Alias" | |
first_name, last_name = value.reverse.split(' ', 2).reverse.collect(&:reverse) | |
first_name = first_name.to_s | |
last_name = last_name.to_s | |
# Refactored to take into account Xavier's pathological aversion to case statements: | |
words = value.split(' ') | |
first_name, last_name = if words.size == 0 | |
['', ''] | |
elsif words.size == 1 |
This file contains hidden or 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
~$ sudo gem install lachlanhardy-gitjour | |
Successfully installed lachlanhardy-gitjour-8.1.0 | |
1 gem installed | |
Installing ri documentation for lachlanhardy-gitjour-8.1.0... | |
Installing RDoc documentation for lachlanhardy-gitjour-8.1.0... | |
Could not find main page README.txt | |
Could not find main page README.txt | |
Could not find main page README.txt | |
Could not find main page README.txt | |
This file contains hidden or 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
The Ruby daemons gem, as used by daemontools, does this to restart daemons: | |
@group.stop_all | |
sleep 1 | |
@group.start_all | |
The stop_all method does not wait for the daemon to exit before returning. | |
Anyone see the huge glaring problem here? *grumble* |
This file contains hidden or 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
My traceroute [v0.75] | |
maxwell.local (0.0.0.0) Fri Mar 27 20:56:20 2009 | |
Keys: Help Display mode Restart statistics Order of fields quit | |
Packets Pings | |
Host Loss% Snt Last Avg Best Wrst StDev | |
1. 192.168.1.254 0.0% 70 1.9 2.9 1.8 12.4 2.1 | |
2. loop0.lns10.mel4.internode.on.ne 0.0% 70 12.0 8.8 7.3 14.7 1.6 | |
3. vl13.cor3.mel4.internode.on.net 0.0% 70 7.8 9.1 7.5 16.3 1.8 | |
4. pos8-0.bdr1.syd7.internode.on.ne 0.0% 70 179.6 185.3 177.6 327.6 24.7 | |
5. pos5-0.bdr1.sjc2.internode.on.ne 0.0% 70 180.2 179.4 177.3 205.0 3.8 |
This file contains hidden or 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 <avr/interrupt.h> | |
union TimerCounter { | |
struct { | |
unsigned int interval_count_lo, interval_count_hi; | |
unsigned char overflow_countdown; | |
}; | |
unsigned long interval_count; | |
}; |
This file contains hidden or 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 'test/unit' | |
require 'enumerator' | |
class Array | |
def in_chunks_of(size_of_chunks) | |
enum_slice(size_of_chunks).to_a | |
end | |
end | |
class TestArrayInChunks < Test::Unit::TestCase |
OlderNewer