Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#
# For OSX, speak the content of the given web page.
#
# Example: say-url http://slashdot.org/
#
w3m -T text/html -dump $* | say
@gugod
gugod / cucumber.yml
Created April 6, 2009 02:22
Cucumber + Watir Example
default: --language zh-TW --format progress .
datetime:
distance_in_words:
half_a_minute: "半分鐘"
less_than_x_seconds:
one: "不到一秒"
other: "不到 {{count}} 秒"
x_seconds:
one: "一秒"
other: "{{count}} 秒"
less_than_x_minutes:
# name: has
# --
has ${1:attribute} => (is => "${2:rw}", isa => "${3:Str}");
@gugod
gugod / has
Created May 4, 2009 14:24
yasnippets for coding with Mosoe
# name: has
# --
has ${1:attribute} => (is => "${2:rw}", isa => "${3:Str}");
class BlankSlate
instance_methods.each { |m| undef_method m unless m =~ /^__/ }
end
class Stuff < BlankSlate
def initialize(obj)
@obj = obj
end
def to_s
#!/usr/bin/env perl
use strict;
use 5.010;
my @foo = qw(1 2 3);
my @bar = qw(a b c);
say "right" if @foo == @bar;
#!/usr/bin/env perl -w
use strict;
use 5.010;
use Net::Twitter;
use DateTimeX::Easy;
use YAML;
my $username = $ARGV[0] || die "Give me an twitter username\n";
sub timecard_image_url {
package DB;
sub uplevel_args {
my @foo = caller($_[0]+1);
return @DB::args;
}
package BlockGiven;
use strict;
use Devel::Declare;
#!/usr/bin/perl -l
use encoding 'utf8';
for my $cchar ("\x{0302}", "\x{030f}") {
print join " ", map { chr($_) . $cchar } 32..126;
print "----";
}