Skip to content

Instantly share code, notes, and snippets.

View rjbs's full-sized avatar
🤝
here to help

Ricardo Signes rjbs

🤝
here to help
View GitHub Profile
#!perl
use 5.20.0;
use charnames ();
use Unicode::UCD 'prop_invlist';
use List::MoreUtils 'natatime';
my $iter = natatime 2, prop_invlist('Cased');
sub cn {
#!/usr/bin/osascript
Contacts = Application("Contacts");
var people = Contacts.groups.byName("Correspondents").people;
var target = people[ Math.floor( Math.random() * people.length ) ];
var first = target.firstName.get();
var last = target.lastName.get();
first + " " + last;
Acme-MITHALDU-BleedingOpenGL-0.67049.tar.gz
Acme-MITHALDU-XSGrabBag-1.161310.tar.gz
Array-Split-1.173190.tar.gz
CGI-Application-Plugin-TT-Any-0.110080.tar.gz
CPAN-Mini-Inject-0.35.tar.gz
CPAN-Mini-Webserver-0.58.tar.gz
Capture-Tiny-Extended-0.114.tar.gz
Code-Statistics-1.112980.tar.gz
Crypt-DH-0.07.tar.gz
DB-Skip-1.132980.tar.gz
File: 02packages.details.txt
URL: http://www.perl.com/CPAN/modules/02packages.details.txt
Description: Package names found in directory $CPAN/authors/id/
Columns: package name, version, path
Intended-For: Automated fetch routines, namespace documentation.
Written-By: PAUSE version 1.005
Line-Count: 27
Last-Updated: Fri, 26 Apr 2019 15:27:31 GMT
Acme::Frog undef L/LO/LOCAL/Acme-Frog-0.001.tar.gz
cpanm (App::cpanminus) 1.7044 on perl 5.026003 built for darwin-2level
Work directory is /Users/rjbs/.cpanm/work/1553389994.25890
You have make /usr/bin/make
You have LWP 6.36
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Searching MP3::Tag () on cpanmetadb ...
--> Working on MP3::Tag
Fetching http://www.cpan.org/authors/id/I/IL/ILYAZ/modules/MP3-Tag-1.15.zip
-> OK

Your Programming Problem

You're going to write a program to break down and store the contents of a bunch of email messages.

Please note that while this is a relatively simple matter of programming, we are particularly interested in seeing the design of your solution. We will evaluate your code not only based on correctness but also based on design and organization. Pretend this is code being written to go into production. If you find parts of the spec unclear, implement what you think makes sense and make a

use 5.20.0;
use warnings;
package Demo {
use Moo;
has raw_x => (
is => 'ro',
required => 1,
init_arg => 'x',
BEGIN:VCALENDAR
VERSION:2.0
PRODID:Data::ICal 0.22
BEGIN:VEVENT
DESCRIPTION:Go To Plumber (🇺🇸)
DTEND;VALUE=DATE:20190127
DTSTAMP:20190129T191547Z
DTSTART;VALUE=DATE:20190127
RRULE:FREQ=DAILY;COUNT=7
SUMMARY:Go To Plumber (🇺🇸)
@rjbs
rjbs / test.pl
Last active January 28, 2019 00:32
use v5.26.0;
use warnings;
use Email::MIME;
use Email::Simple;
{
my $text = <<~'END';
Header-A: Foo
Subject: =?UTF-8?B?VGhpcyBpcyBhIHJlYWxseSBsb25nIGxpbmUgdGhhdCB3aWxsIGVuZCB1cCBnb2luZyBvdmVyIDc4IGNoYXJhY3RlcnMgd2hlbiBlbmNvZGVkIGZvciBVVEYtOA==?=
Header-B: Bar
use strict;
use warnings;
use Email::Simple;
my $text = <<'END';
Header-A: Foo
Subject: =?UTF-8?B?VGhpcyBpcyBhIHJlYWxseSBsb25nIGxpbmUgdGhhdCB3aWxsIGVuZCB1cCBnb2luZyBvdmVyIDc4IGNoYXJhY3RlcnMgd2hlbiBlbmNvZGVkIGZvciBVVEYtOA==?=
Header-B: Bar
Body