Skip to content

Instantly share code, notes, and snippets.

View dolmen's full-sized avatar
😁
Happy!

Olivier Mengué dolmen

😁
Happy!
View GitHub Profile
@dolmen
dolmen / get-glyphicons.pl
Last active December 21, 2015 12:29
Hi-jacking File::Fetch API for AnyEvent-backed parallel file download
#!/usr/bin/perl
use 5.014;
use strict;
use warnings;
{
package File::Fetch::AnyEvent::HTTP;
@mmacedo
mmacedo / source.fish
Last active August 9, 2017 04:49
Source bash/zsh/ksh files
function _exec_with
set -l shell $argv[1]
set -l file $argv[2]
set -l code $argv[3]
set -l source
switch "$shell"
case bash zsh ksh
set source .
case '*'
package main
import (
"fmt"
"time"
)
func main() {
t, err := time.Parse(time.RFC3339Nano, "2013-06-05T14:10:43.678Z")
if err != nil {
#!/usr/bin/env perl
use Mojolicious::Lite;
use Coro;
use Mojo::IOLoop;
# Magical class for calling a method non-blocking (with a closure) and
# rescheduling the current coroutine until it is done
package with::coro {
use Coro;
@gnarf
gnarf / ..git-pr.md
Last active January 27, 2025 01:56
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use DDS;
use DateTime;
use JSON::XS;
use File::Slurp qw/read_file write_file/;
use Parse::CPAN::Authors;
use Parse::CPAN::Packages;
@dolmen
dolmen / dzil profiling.md
Last active December 11, 2015 11:48
Dist::Zilla profiling
# Get the module list
PROFILING=-d:TraceUse
# Profile with Devel::NYTProf
PROFILING=-d:NYTProf

Quick dzil launch hack:

perl $PROFILING -Ilib -MDist::Zilla -e '$Dist::Zilla::VERSION=$Dist::Zilla::Plugin::GatherDir::VERSION=4.300030; require "bin/dzil"' nop
use strict;
use constant_tiny;
use constant pi => 4 * atan2(1, 1);
use constant ponies => qw<
Twilight_Sparkle Fluttershy Pinkie_Pie AppleJack Rainbow_Dash Rarity
>;
use constant {
@dolmen
dolmen / rt-cli-useful.md
Created January 18, 2013 16:06
rt-cli useful requests
@briandfoy
briandfoy / perl-cert.json
Last active December 11, 2015 01:48
A JSON representation of the CERT Perl Secure Coding Standards (https://www.securecoding.cert.org/confluence/display/perl/CERT+Perl+Secure+Coding+Standard)
[
{
"priority" : "P4",
"name" : "Canonicalize path names before validating them",
"rule" : "",
"section" : "1",
"recommedation" : "1",
"level" : "L3",
"url" : "https://www.securecoding.cert.org/confluence/display/perl/IDS00-PL.+Canonicalize+path+names+before+validating+them",
"class" : "IDS00-PL",