Skip to content

Instantly share code, notes, and snippets.

Guillaume Martin guillaume-martin

Block or report user

Report or block guillaume-martin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@guillaume-martin
guillaume-martin / .tmux.conf
Created Jan 11, 2018
configuration file for tmux
View .tmux.conf
# more settings: https://pastebin.com/4ZCTcf7m
# 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
guillaume-martin / pandas-read-sql-from-psql.py
Created Jul 28, 2017
Create a pandas dataframe from an sql query to a remote psql database
View pandas-read-sql-from-psql.py
import pandas as pd
from sqlalchemy import create_engine
driver = "postgresql"
server = ""
port = "5432"
database = ""
uid = ""
pwd = ""
@guillaume-martin
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 - http://MediaDoneRight.com
# SETUP CONSTANTS
# 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 http://stackoverflow.com/a/2728344
# 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
guillaume-martin / .gitignore
Created Oct 1, 2014
augmented .gitignore file
View .gitignore
# Ignore bundler config.
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
You can’t perform that action at this time.