Skip to content

Instantly share code, notes, and snippets.


Mohammed Le Doze mledoze

View GitHub Profile
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# Add `~/bin` to the `$PATH`
export PATH="$PATH:$HOME/bin"
export TERM='xterm-256color'
View .bash_aliases
# ls aliases
alias ls="ls ${colorflag}"
alias l="ls -lhF ${colorflag}"
alias ll="ls -lhF ${colorflag}"
# List all files colorized in long format, including dot files
alias la="ls -laF ${colorflag}"
# List only directories
View .vimrc
set ai " set auto-indenting on for programming
set showmatch " automatically show matching brackets. works like it does in bbedit.
set vb " turn on the "visual bell" - which is much quieter than the "audio blink"
set ruler " show the cursor position all the time
set laststatus=2 " make the last line where the status is two lines deep so you can see status always
set backspace=indent,eol,start " make that backspace key work the way it should
set nocompatible " vi compatible is LAME
set background=dark " Use colours that work well on a dark background (Console is usually black)
set showmode " show the current mode
set clipboard=unnamed " set clipboard to unnamed to access the system clipboard under windows
View .minttyrc
View .gitconfig
name = Mohammed Le Doze
email =
lga = log --decorate --stat --graph --pretty=format:\"%d %Cgreen%h%Creset (%ar - %Cred%an%Creset), %s%n\"
lg = log --decorate --graph --format='%Cgreen%h%Creset %ad %C(cyan)%an%Creset - %s%C(red)%d%Creset' --date=short
l = log --graph --pretty=format:'%Cred%h%Creset - %C(bold blue)%an%Creset -%C(red)%d%Creset %s %Cgreen(%cr)' --abbrev-commit --all
stat = shortlog -sne

Keybase proof

I hereby claim:

  • I am mledoze on github.
  • I am mledoze ( on keybase.
  • I have a public key ASAXSv9KIVEcT_sqn-YwKid8qV26N6racsqFX_KXytmLago

To claim this, I am signing this object:

mledoze / consul
Last active Jan 26, 2016 — forked from stojg/consul
consul service init script for debian (support access from a docker)
View consul
# Provides: consul
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: Consul service discovery framework
# Description: Healthchecks local services and registers
# them in a central consul database.
from lxml import html #pip install lxml
import requests, time, os.path, json
save_to = 'flags_new' #folder where you want to save. NO / !
temp_data, data = {}, {}
def stripper(c_name):
print('Doing: ', c_name)
page = requests.get('' + c_name + '.svg') #loads the webpage
tree = html.fromstring(page.text) #html to xpath tree
mledoze /
Last active Feb 16, 2021
This tutorial explains how to download videos from

Edit 2021/02/16: warning

This gist is very old. I don't even know if it still works. Check the comments below to find more robust solutions, like youtube-dl for example, see this comment.


Go to and select any videos, for example


In the source code extract the src parameter of the iframe player:

mledoze / home-on-the-range.php
Created Jun 27, 2012
PHP implementaion for "Home On The Range" Code Golf's challenge
View home-on-the-range.php
* The Problem
* It's difficult to spot what's missing in a long list of numbers if they are just listed one after the other.
* You can make it easier by organising the numbers into ranges, and that's exactly what you're going to do here.
* Your program will receive a set of space-separated numbers on stdin, and it will be expected to print a set of
* ranges on stdout formatted according to the following rules :