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
my $client = Fastmail::Client->....;
my $mbox_res = $client->request([
[ 'Mailbox/get', { accountId => ... } ],
]);
# Get all the mailbox objects:
my @boxes = $mbox_res->single_sentence('Mailbox/get')->arguments->{list}->@*;

Perl Rules of Governance

Preamble

We are forming a system of governance for development of the Perl programming language.

The scope of governance includes the language definition, its implementation, its test suite, its documentation, and the policies and procedures by which it is developed and maintained.

#!/usr/bin/env perl
use strict;
use 5.10.1;
use autodie;
use JSON::PP;
use Tie::IxHash;
open my $fh, '<', ($ARGV[0] || '.git/index');
-i=2 # standard indent
-ce # cuddly elses
-pt=2 # parentheses should be tight
-nsfs # no space before "for" loop semicolon
-nolq # don't outdent long quotes
-b # edit file in place, leave .bak file
-nola # don't outdent labels
-msc=1 # two spaces for post-line comments (not 4)
-bom # keep old breaks before method calls
use v5.20.0;
use Term::ReadKey ();
sub terminal_bg_info {
syswrite *STDOUT, "\e]11;?\007";
# Example response:
# ^[]11;rgb:00/00/00^G^[]11;rgb:00/00/00^G
#
use v5.20.0;
use warnings;
use IO::Async;
use IO::Async::Timer::Periodic;
use Tickit::Async;
use Tickit::Widget::Static;
use Tickit::Widget::GridBox;
use List::MoreUtils qw(natatime);
@rjbs
rjbs / lc
Last active March 8, 2020 04:13
use v5.20.0;
package CliM8::LoopControl::Continue {
use Moo;
sub throw { die $_[0]; }
no Moo;
}
package CliM8::LoopControl::Pop {
use Moo;
#!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