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
| #!/bin/sh | |
| # | |
| # For OSX, speak the content of the given web page. | |
| # | |
| # Example: say-url http://slashdot.org/ | |
| # | |
| w3m -T text/html -dump $* | say |
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
| default: --language zh-TW --format progress . | |
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
| datetime: | |
| distance_in_words: | |
| half_a_minute: "半分鐘" | |
| less_than_x_seconds: | |
| one: "不到一秒" | |
| other: "不到 {{count}} 秒" | |
| x_seconds: | |
| one: "一秒" | |
| other: "{{count}} 秒" | |
| less_than_x_minutes: |
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
| # name: has | |
| # -- | |
| has ${1:attribute} => (is => "${2:rw}", isa => "${3:Str}"); |
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
| # name: has | |
| # -- | |
| has ${1:attribute} => (is => "${2:rw}", isa => "${3:Str}"); |
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
| class BlankSlate | |
| instance_methods.each { |m| undef_method m unless m =~ /^__/ } | |
| end | |
| class Stuff < BlankSlate | |
| def initialize(obj) | |
| @obj = obj | |
| end | |
| def to_s |
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
| #!/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; |
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
| #!/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 { |
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
| package DB; | |
| sub uplevel_args { | |
| my @foo = caller($_[0]+1); | |
| return @DB::args; | |
| } | |
| package BlockGiven; | |
| use strict; | |
| use Devel::Declare; |
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
| #!/usr/bin/perl -l | |
| use encoding 'utf8'; | |
| for my $cchar ("\x{0302}", "\x{030f}") { | |
| print join " ", map { chr($_) . $cchar } 32..126; | |
| print "----"; | |
| } |