Skip to content

Instantly share code, notes, and snippets.

View mledoze's full-sized avatar
🦆

Mohammed Le Doze mledoze

🦆
View GitHub Profile
# ~/.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'
# ls aliases
colorflag="--color"
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
@mledoze
mledoze / .vimrc
Created September 13, 2019 08:00
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
BoldAsFont=-1
Term=xterm-256color
Transparency=off
OpaqueWhenFocused=no
CursorType=block
CursorBlinks=no
FontSmoothing=full
Font=Consolas
RightClickAction=paste
[user]
name = Mohammed Le Doze
email = [email protected]
[alias]
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
@mledoze
mledoze / keybase.md
Created February 5, 2016 08:41
Keybase proof

Keybase proof

I hereby claim:

  • I am mledoze on github.
  • I am mledoze (https://keybase.io/mledoze) on keybase.
  • I have a public key ASAXSv9KIVEcT_sqn-YwKid8qV26N6racsqFX_KXytmLago

To claim this, I am signing this object:

@mledoze
mledoze / consul
Last active January 26, 2016 14:46 — forked from stojg/consul
consul service init script for debian (support access from a docker)
#!/bin/sh
### BEGIN INIT INFO
# 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('https://en.wikipedia.org/wiki/File:Flag_of_' + c_name + '.svg') #loads the webpage
tree = html.fromstring(page.text) #html to xpath tree
@mledoze
mledoze / download-arte.tv-videos.md
Last active February 16, 2021 20:43
This tutorial explains how to download videos from http://www.arte.tv/

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.

1

Go to http://www.arte.tv/ and select any videos, for example http://www.arte.tv/guide/fr/046618-011/silex-and-the-city

2

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

http://www.arte.tv/player/v2/index.php?json_url=http%3A%2F%2Farte.tv%2Fpapi%2Ftvguide%2Fvideos%2Fstream%2Fplayer%2FF%2F046618-011_PLUS7-F%2FALL%2FALL.json&lang=fr_FR&config=arte_tvguide&rendering_place=http://www.arte.tv/guide/fr/046618-011/silex-and-the-city

@mledoze
mledoze / home-on-the-range.php
Created June 27, 2012 14:10
PHP implementaion for "Home On The Range" Code Golf's challenge
<?php
/*
* http://codegolf.com/home-on-the-range
*
* 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 :