Skip to content

Instantly share code, notes, and snippets.


Guillaume Martin guillaume-martin

View GitHub Profile
guillaume-martin / .tmux.conf
Created Jan 11, 2018
configuration file for tmux
View .tmux.conf
# more settings:
# set prefix to Ctrl-a
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
# use Alt-arraw keys to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
guillaume-martin /
Created Jul 28, 2017
Create a pandas dataframe from an sql query to a remote psql database
import pandas as pd
from sqlalchemy import create_engine
driver = "postgresql"
server = ""
port = "5432"
database = ""
uid = ""
pwd = ""
guillaume-martin / .bash_aliases
Created Feb 12, 2015
show git branch in bash prompt
View .bash_aliases
# customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart -
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
View is_chinese()
# modified from
# iterate through all characters of a string
# returns true if all characters are chinese and false otherwise
def is_chinese(str)
result = nil
unless str.nil?
# put utf of each character in array
list_of_chars = str.unpack("U*")
# control if each character is a chinese character
# breaks if find a non chinese character
guillaume-martin / .gitignore
Created Oct 1, 2014
augmented .gitignore file
View .gitignore
# Ignore bundler config.
# Ignore the default SQLite database.
# Ignore all logfiles and tempfiles.