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 / cpanm-dynamic-patch.pl
Last active August 29, 2015 14:14 — forked from kentfredric/winrar.pl
Monkey patching a fatpacked script (cpanm)
#!/usr/bin/env perl
# Dynamically patch cpanm
# Alternative implementation to:
# https://gist.github.com/kentfredric/ce1df3e7e509e071b63d
use strict;
use 5.010001;
use warnings;
use Scalar::Util qw(blessed);
#!/bin/zsh
export TESTS=${TESTS:-1000000}
# liberated from liquidprompt
local ti_sgr0="$( { tput sgr0 || tput me ; } 2>/dev/null )"
local ti_bold="$( { tput bold || tput md ; } 2>/dev/null )"
if tput setaf >/dev/null 2>&1 ; then
ti_setaf () { tput setaf "$1" ; }
elif tput AF >/dev/null 2>&1 ; then
@dolmen
dolmen / rio.coffee
Created February 11, 2012 15:32 — forked from Zenithar/rio.coffee
Checksum RIO (portabilité de numéro de téléphone en France)
# Copiez sur coffeescript.org, onglet "Try CoffeeScript" pour l'exécuter en ligne.
exports = {}
#
# Used to calculate the checksum
# http://fr.wikipedia.org/wiki/Relev%C3%A9_d'identit%C3%A9_op%C3%A9rateur
#
exports.calcChksm = (oo, q, rrrrrr, notel) ->
concatenation = "#{oo}#{q}#{rrrrrr}#{notel}"
ordre = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+"