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
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
@rjbs
rjbs / tcp.rs
Created September 28, 2018 03:06
use std::io::{Read,Write};
use std::net::{TcpListener,TcpStream};
use std::thread;
fn read_str (stream: &mut TcpStream) -> String {
let mut buf = vec![0u8; 256];
let x = stream.read(&mut buf).unwrap();
println!("read {} bytes", x);
if buf[x-2] == b'\r' && buf[x-1] == b'\n' {
#!/usr/bin/perl
#
# TODO: Still fails when files may contain spaces
#
# Should accept multiple commit names or commit ranges
#
# I think it fails when the WD is not the root of the repo
use strict;
use Getopt::Std;
distfile meta_dist_version dist_version
-------------------------------------------------- -------------------- --------------------
AAKHTER/Visio-1.010.tar.gz 1.008 1.010
AAR/Module-Crypt-0.06.tar.gz 0.05 0.06
AARONSCA/Cisco-CopyConfig-1.4.tgz 1.03 1.4
ABCDEFGH/RTx-BecomeUser-1.0.tar.gz 0.01 1.0
ABERNDT/Win32-Snarl/win32-snarl-1.01.tar.gz 0.04 1.01
ABEVERLEY/Device-VantagePro-0.25.tar.gz 0.24 0.25
AFYODOROV/Test-Doctest-0.02-50a0b7b.tar.gz 0.02 0.02-50a0b7b
AGENT/Template-Ast-0.02.zip 0.01 0.02