Skip to content

Instantly share code, notes, and snippets.

Avatar
😁
Happy!

Olivier Mengué dolmen

😁
Happy!
View GitHub Profile
@dolmen
dolmen / cpanm-dynamic-patch.pl
Last active Aug 29, 2015 — forked from kentfredric/winrar.pl
Monkey patching a fatpacked script (cpanm)
View cpanm-dynamic-patch.pl
#!/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);
View prompt_timing.zsh
#!/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 Feb 11, 2012 — forked from Zenithar/rio.coffee
Checksum RIO (portabilité de numéro de téléphone en France)
View rio.coffee
# 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+"
You can’t perform that action at this time.