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
# The Computer Language Benchmarks Game | |
# http://shootout.alioth.debian.org/ | |
# contributed by Rodrigo de Oliveira 29/mar/2010 | |
# based on the Python original by Daniel Nanz | |
use strict; | |
use warnings; | |
use threads; | |
use threads::shared; | |
use Thread::Semaphore; |
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
# The Computer Language Benchmarks Game | |
# http://shootout.alioth.debian.org/ | |
# contributed by Rodrigo de Oliveira 29/mar/2010 | |
# based on the original version by Jesse Millikian | |
use threads; | |
use threads::shared; | |
use Thread::Semaphore; | |
my @creature_colors = qw/blue red yellow/; |
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
javascript:(function() { | |
var pre = document.body.children[0]; | |
var code = pre.innerHTML; | |
code = code.replace( /(([A-Z]\w+::[A-Z]\w+)(::[A-Z]\w+)*)/g, | |
'<a class="perldoc" href="http://search.cpan.org/perldoc?$1">$1</a>' ); | |
code = code.replace( /^(use|require) (\w+(::\w+)*)/gm, | |
'$1 <a class="perldoc" href="http://search.cpan.org/perldoc?$2">$2</a>' ); | |
var html = ' |
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
#perl | |
grep { not $_ % 2 } (1,2,3,4) | |
#ruby | |
[1,2,3,4].select{ |x| x.even? } | |
#python | |
[x for x in [1,2,3,4] if not x%2] | |
#or, more norvingly | |
filter(lambda x: not x%2, [1,2,3,4]) |
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
# set | |
my $corr = { from=>'', to=>'', msg=>'' }; | |
my $ns = 'sqauser/jack' ; | |
my $data = repo->get( $ns ); | |
$data ||= {}; # inicializa si está vacio | |
push @{ $data->{correos} }, $corr; | |
repo->set( ns=>$ns, data=>$data ); |
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 | |
=head1 DESCRIPTION | |
IMAP downloader. | |
Usage: | |
perl imap.pl -u 'user' -p 'password' -s 'imap.gmail.com' -d './download-dir' -subdir 'maildir' -q 'search-query' -id 999 -from 999 |
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 v5.14; | |
use Path::Class; | |
use Class::Date qw(date now); | |
use Getopt::Mini var => 'opts' ; | |
my %mods ; | |
my $k = 0; | |
#use YAML; |
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
use strict; | |
use warnings; | |
use v5.10; | |
use MongoDB; | |
use Time::HiRes qw/usleep /; | |
use Class::Date; | |
use DateTime; | |
my $connection = MongoDB::Connection->new(); | |
my $db = $connection->get_database("queue"); |
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
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#" xml:lang="en" lang="en"> | |
<!-- Svbtle Theme for Tumblr by matteoroversi.com --> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<meta http-equiv="imagetoolbar" content="false" /> |
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
use Mojolicious::Lite; | |
use Protocol::SocketIO::Message; | |
use Protocol::SocketIO::Handshake; | |
use Class::Date; | |
any '/' => 'index'; | |
any '/view1' => 'index'; | |
any '/view2' => 'index'; | |
any '/partials/:name' => sub { |
OlderNewer