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
| twitter_api_method users_lookup => ( | |
| description => 'Fetches user informations, given a list of comma-separated user_ids', | |
| path => 'users/lookup', | |
| method => 'GET', | |
| params => [qw/user_id cached cache/], | |
| required => [qw/user_id/], | |
| returns => 'HashRef', | |
| authenticate => 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
| per ogni token dallo stream: | |
| se il token è l'apertura di un tag, e il tag appartiene | |
| all'insieme di quelli nei quali vuoi fare l'escape: | |
| sono_dentro_ai_tag_incriminati = 1 | |
| stampo il token così com'è | |
| se il token e` un pezzo di testo: | |
| se sono_dentro_ai_tag_incriminati == 1 | |
| escape | |
| stampo il risultato |
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
| import Data.Map as Map | |
| type Inventory = [String] | |
| data Direction = North | |
| | South | |
| | East | |
| | West | |
| | Up | |
| | Down |
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
| sub parse_log_line { | |
| my $log_line = shift; | |
| my $monthname_numbers = { | |
| Jan => "01", Feb => "02", Mar => "03", Apr => "04", | |
| May => "05", Jun => "06", Jul => "07", Aug => "08", | |
| Sep => "09", Oct => "10", Nov => "11", Dec => "12" | |
| }; | |
| if ($log_line =~ /^(.*?) - - \[(.*)\] "(.*)" (\d+) \d+ "(.*)" "(.*)" hostname ".*?"/) { |
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
| use strict; | |
| use warnings; | |
| use feature qw/ say /; | |
| my $timeout = 10; # seconds | |
| my $maxlines = 10; | |
| eval { | |
| local $SIG{ ALRM } = sub { |
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 | |
| use strict; | |
| use warnings; | |
| use feature qw/ say /; | |
| use File::Tail; | |
| my $filename = "test.txt"; | |
| my $maxlines = 10; |
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
| use strict; | |
| use warnings; | |
| use feature qw/ say /; | |
| use constant MXM_HM_GROUP => 9604; | |
| use Net::Hiveminder; | |
| use DateTime; | |
| my $next_week = DateTime->now->add( days => 7 ); |
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
| use strict; | |
| use warnings; | |
| use feature qw/ say /; | |
| use constant MXM_HM_GROUP => 9604; | |
| use Net::Hiveminder; | |
| use DateTime; | |
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
| struct Column { | |
| 1: required binary name, | |
| 2: optional binary value, | |
| 3: optional i64 timestamp, | |
| 4: optional i32 ttl, | |
| } | |
| ... | |
| service Cassandra { |
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 Cassandra::Column; | |
| use base qw(Class::Accessor); | |
| Cassandra::Column->mk_accessors( qw( name value timestamp ttl ) ); |