Skip to content

Instantly share code, notes, and snippets.

@urodoz
urodoz / .bashrc
Created July 13, 2017 14:51
Set of useful Git alias and functions to increase productivity
alias gfo='git fetch origin'
alias gs='git status -sb'
# Automatically generates the bump commit and tags
# Usage: bump 1.0.4
function bump() {
echo "-- [$1] Bump commit"
git commit -am"Bump to $1"
echo "-- [$1] Tagging
git tag $1
@urodoz
urodoz / .bashrc
Created July 13, 2017 18:01
Fast find file function with filter
# Search on the current directory a matching file
# Find all files containing the args
# Usage: ff sample
function ff() {
find . -print |grep -i "$@"
}
@urodoz
urodoz / extract_emails.sh
Last active September 25, 2017 07:19
Bash script to extract emails from file
#!/bin/bash
#Usage: bash extract_emails.sh file.txt output.txt
perl -ne'if(/[\w\.\-\_]+@([\w\-\_]+\.)+[A-Za-z]{2,4}/g){print "$&\n"}' $1 | sort | uniq > $2
@urodoz
urodoz / excel_parser.py
Last active May 26, 2019 14:07
Convert Excel file to list of dicts with headers as key name for each value with pyopenxl
from xlrd import open_workbook
class ExcelParser(object):
def excel_to_list(self, file_path):
wb = open_workbook(file_path)
rows = []
for sheet in wb.sheets():