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 / 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';
use strict;
use warnings;
sub hashgregate(&@){
my $sub = shift;
my %agg;
push @{$agg{$sub->($_)}}, $_ for @_;
return wantarray ? %agg : \%agg;
}
@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) {
@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 / 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 / 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 / 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 / coursera_time_left.js
Created November 7, 2014 22:27
Coursera GMscript for time left
// ==UserScript==
// @name Show time remaining
// @namespace Yanick
// @description Show the tiem of videos remaining
// @include https://class.coursera.org/proglang-003/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @version 1
// @grant none
// ==/UserScript==
@yanick
yanick / shellshot.bash
Last active August 29, 2015 14:08
CatalystX::Info
$ perl -MMyApp -MCatalystX::Info -E'say CatalystX::Info->new(app => "MyApp")->chained_actions->as_string'
.---------------------------.
| Chained actions |
+----------------+----------+
| Path Spec | Private |
+----------------+----------+
| /foo/*/bar/*/* | /foo (1) |
| | => /bar |
'----------------+----------'
@yanick
yanick / oll_korrect.pl
Last active August 29, 2015 14:05
==b o.o and ==q ò.ó operators
use 5.20.0;
use utf8;
use experimental 'postderef';
package Approved;
sub o { '9.9 oh my... suuuuure, why not?' }
sub b { pop }