Skip to content

Instantly share code, notes, and snippets.


Olivier Mengué dolmen

View GitHub Profile
dolmen / which.cmd
Created Aug 27, 2010
'which' command for Win32
View which.cmd
@echo off
:: Copyright © 2010-2011 Olivier Mengu‚
:: This program is free software: you can redistribute it and/or modify
:: it under the terms of the GNU General Public License as published by
:: the Free Software Foundation, either version 3 of the License, or
:: (at your option) any later version.
:: This program is distributed in the hope that it will be useful,
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
dolmen /
Created Jun 24, 2020
Git aliases for Go developement #golang #git
# git go-version: shows the Go-modules versionning formatting of a Git commit
git config --global alias.go-version '!f(){ TZ=UTC git log -1 '\''--date=format-local:%Y%m%d%H%M%S'\'' --abbrev=12 '\''--pretty=tformat:v0.0.0-%cd-%h'\'' "$@" ;};f'
# git go-shorlog: shows the 10 commits in Go-modules versionning style
git config --global alias.go-shortlog '!f(){ TZ=UTC git log -10 '\''--date=format-local:%Y%m%d%H%M%S'\'' --abbrev=12 '\''--pretty=tformat:v0.0.0-%cd-%h %s'\'' "$@" ;};f'
dolmen / fix-url.go
Created Jun 12, 2020
Fix malformed URL query
View fix-url.go
// Fix (some kinds of) malformed URLs
package main
import (
dolmen /
Created Jan 4, 2016
Using Google Sheets from Perl 5
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use GSheets;
use Term::Prompt 'prompt';
my $oauth2 = $GSheets::OAUTH2;
dolmen /
Last active Apr 23, 2020
Design for a Go tool for moving symbols from a package to another: gomvfile

gomvfile design draft

This is a design draft for a tool (gomvfile) that would allow to migrate a set of symbols from a package to another.

Strategy for symbols migration

  1. Isolate symbols that have to move: move all symbols to migrate into one or multiple separate source files. Those sources must not have depenencies on the internals (private symbols, private struct members) of the rest of the package.
  2. Use gomvfile to migrate the files to the target package


dolmen /
Last active Mar 6, 2020


Rebuild the binaries you have built in Go module mode installed in $GOPATH/bin.

Usage: go-bin-upgrade [-n] [-v] bin1 [bin2]...


  • go-bin-upgrade -n godoc
  • (cd ~/go/bin ; go-bin-upgrade * )
dolmen /
Created May 9, 2011
My patching workflow with Git (GraphViz)
// My Git worflow, when patching external projects
// Copyright (C) 2011 Olivier Mengué. All rights reserved.
// dot -Tpng -o git-patching-workflow.png
digraph {
find_repo [ label="Find an interesting project on GitHub (or another Git repository)"];
use [ label="Use, test..." ];
bug_idea [ label="Find a bug or idea for a feature" ];
dolmen / export-wifi-profiles.cmd
Created Mar 10, 2011
Export all Windows Wifi profiles (SSID, password) in XML
View export-wifi-profiles.cmd
:: Run with full administrator rights
netsh wlan export profile folder=. key=clear
dolmen / perl-env.cmd
Created Apr 11, 2011
Switches environment between ActivePerl and StrawberryPerl
View perl-env.cmd
@echo off
if "%1"=="" goto :ShowEnv
if /I "%1"=="SB" set NewPerlDir=C:\strawberry\perl
if /I "%1"=="AS" set NewPerlDir=C:\Perl
dolmen /
Last active Mar 1, 2019
Nautilus script to convert a photo to reduced width of 400px
#!/usr/bin/env perl
# Install as a Nautilus script:
# perl --install
# Install dependencies:
# sudo aptitude install libimage-exiftool-perl libpath-tiny-perl imagemagick zenity
# Author: Olivier Mengué
# Created: Sun Feb 28 20:30:55 2016 +0100
You can’t perform that action at this time.