- GitHub Staff
- https://bento.me/kyanny
- @kyanny
- in/kyanny
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 perl | |
use strict; | |
use Text::CSV_XS; | |
use Data::Dumper; | |
use Perl6::Say; | |
use Email::Address::Loose; | |
my $csv = Text::CSV_XS->new; | |
while (my $row = $csv->getline(*STDIN)) { |
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 perl | |
use strict; | |
use Array::Diff; | |
use Data::Dumper; | |
my ($old, $new) = @ARGV; | |
open my $io, '<', $old; | |
my @old = <$io>; | |
chomp @old; | |
close $io; |
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
<script src="http://www.google.com/jsapi"></script> | |
<script type="text/javascript"> | |
if (location.href.match(/^http:\/\/.*?\/archives\/\d+\.html$/)) { | |
google.load('jquery', '1'); | |
google.setOnLoadCallback(function(){ | |
$('<a>').attr({ | |
href : 'http://b.hatena.ne.jp/entry/' + location.href | |
}).append( | |
$('<img>').attr({ | |
src : 'http://d.hatena.ne.jp/images/b_entry.gif', |
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 perl | |
use strict; | |
use warnings; | |
use Getopt::Long::Descriptive; | |
use WebService::Simple; | |
use Encode; | |
use Term::Encoding qw(term_encoding); | |
my $base_url = 'http://weather.livedoor.com/forecast/webservice/rest/v1'; |
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 perl | |
use strict; | |
use HTML::TokeParser; | |
my $filename = shift or die; | |
my $p = HTML::TokeParser->new($filename); | |
my $html; | |
while (my $token = $p->get_token) { | |
if ($token->[0] eq 'S' |
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
#import <Cocoa/Cocoa.h> | |
int main(int argc, const char *argv[]) { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
NSURL *url = [NSURL URLWithString:@"http://clip.livedoor.com/"]; | |
NSURLRequest *request = [NSURLRequest requestWithURL:url]; | |
NSURLResponse *response; | |
NSError *error; | |
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; | |
printf("%d\n", [data length]); |
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
#import <Cocoa/Cocoa.h> | |
int main(int argc, const char *argv[]) { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
NSString *string; | |
NSArray *array; | |
string = @"foo<>bar<>baz"; | |
//string = [[NSString alloc] initWithString:@"foo<>bar<>baz"]; | |
array = [string componentsSeparatedByString:@"<>"]; | |
printf("%d\n", [array count]); |
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
#import <Cocoa/Cocoa.h> | |
@interface Split : NSObject | |
{ | |
} | |
- (NSArray *)split:(NSString *)string; | |
@end | |
@implementation Split | |
- (NSArray *)split:(NSString *)string |
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
;; key modifier | |
(when (and (eq system-type 'darwin) (eq window-system 'ns)) | |
(setq mac-command-modifier 'meta) | |
(setq mac-option-modifier 'super)) |
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 perl | |
use strict; | |
use DateTime; | |
use DateTime::Duration; | |
use Benchmark qw(timethese cmpthese); | |
use Date::Calc qw(check_date check_time Today Today_and_Now Delta_DHMS); | |
use Data::Dumper; | |
$Data::Dumper::Terse = 1; | |
$Data::Dumper::Indent = 0; |