Skip to content

Instantly share code, notes, and snippets.

View yanick's full-sized avatar
🏠
Working from home

Yanick Champoux yanick

🏠
Working from home
View GitHub Profile
@yanick
yanick / anon.pl
Created January 26, 2015 18:33
anonymize/deanonymize emails
#!/usr/bin/perl
use 5.20.0;
use warnings;
use AnyEvent::SMTP::Server 'smtp_server';
use CHI;
use Email::Simple;
my $email_forward_cache = CHI->new(
@yanick
yanick / hashrayref
Created February 2, 2015 16:01
It's an arrayref, it's an hashref, it's a... hashrayref!
use strict;
use Data::Printer;
sub x { \@_ }
my %foo = 'a'..'d';
my $bar = x(%foo);
$foo{a} = "banana";
@yanick
yanick / omniplan_export.pl
Created March 21, 2015 17:50
Abusing File::Serialize to the max
#!/usr/bin/env perl
use strict;
use warnings;
use File::Serialize;
use List::Util qw/ pairmap /;
use DDP;
my ( @parent, $tasks, $crew );
@yanick
yanick / jasmine_tap.js
Created April 1, 2015 19:52
TAP-ish wrappers for Jasmine
// I miss TAP...
function pass() { return expect(true).toBeTruthy() }
function fail() { return expect(false).toBeTruthy() }
function ok(thing) { return expect(thing).toBeTruthy() }
function is(have,expected) { return expect(have).toBe(expected) }
@yanick
yanick / UnicodePicker.pl
Created May 29, 2015 14:40
VimX unicode picker
use Vim::X;
use App::Uni;
use 5.20.0;
use strict;
no warnings;
sub UnicodePicker :Vim(args) {
use strict;
use warnings;
sub hashgregate(&@){
my $sub = shift;
my %agg;
push @{$agg{$sub->($_)}}, $_ for @_;
return wantarray ? %agg : \%agg;
}
@yanick
yanick / jsman.pl
Created August 3, 2015 23:02
Get the parsed jsdoc, then generate a text version of the document
#!/usr/bin/perl
use 5.20.0;
package JSDoc::Viewer;
use Moose;
use Template::Caribou;
with 'Template::Caribou';
@yanick
yanick / 0_reuse_code.js
Created January 21, 2016 19:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@yanick
yanick / mcpan.pl
Last active October 21, 2016 20:25
quick metacpan cli interface
#!/usr/bin/env perl
=usage
mcpan moosex
=cut
use 5.20.0;
@yanick
yanick / gist:a7db7c1906c820443c18bed331c0e0b0
Created March 9, 2017 18:08
synopsis of toronto's talk
# To JavaScript and Back: Transfixing Tales of Transglotting Thefts (in Toronto)
Last year, Yanick took a deep dive into the JavaScript ecosystem and avidly drank
from the framework firehose. As part of the journey to understanding, he was
caught uttering "I wonder what that would look like in Perl..." a few times.
In this talk, we'll visit the result of this clash between learning and
hubris. We'll touch
[Redux](http://redux.js.org/)/[Pollux](https://metacpan.org/release/Pollux),
[MobX](https://mobx.js.org/)/[MoobX](https://metacpan.org/release/MoobX), and might even