Skip to content

Instantly share code, notes, and snippets.

urodoz /
Last active May 26, 2019
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():
urodoz /
Last active Sep 25, 2017
Bash script to extract emails from file
#Usage: bash file.txt output.txt
perl -ne'if(/[\w\.\-\_]+@([\w\-\_]+\.)+[A-Za-z]{2,4}/g){print "$&\n"}' $1 | sort | uniq > $2
urodoz / .bashrc
Created Jul 13, 2017
Fast find file function with filter
View .bashrc
# Search on the current directory a matching file
# Find all files containing the args
# Usage: ff sample
function ff() {
find . -print |grep -i "$@"
urodoz / .bashrc
Created Jul 13, 2017
Set of useful Git alias and functions to increase productivity
View .bashrc
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
View ellipsis.css
/* Applies ellipsis to the text container */
.text-elipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
urodoz /
Created Jun 12, 2017
ctags for js project
ctags -R \
--exclude=.git \
--exclude=src/node_modules/* \
--exclude=node_modules/* \
--exclude=src/bower_components/* \
# Javascript tags
find ./src/app -type f -iregex ".*\.js$" \
-not -path "./node_modules/*,./src/node_modules/*,./src/bower_components/*" \
urodoz / Dockerfile
Created Apr 15, 2017
Circus in Dockerfile
View Dockerfile
FROM node:7.9.0
MAINTAINER Albert Lacarta <>
RUN npm install -g bower@1.8.0 && \
npm install -g node-sass && \
npm install -g http-server && \
npm install -g gulp-cli
# Install circus to handle processes
RUN apt-get update && apt-get install -y python-pip python python-dev
urodoz / Dockerfile
Created Apr 15, 2017
Dockerfile with self signed SSL Certificate
View Dockerfile
FROM python:2.7.13
MAINTAINER Albert Lacarta <>
ADD requirements.txt /opt/requirements.txt
RUN pip install -r /opt/requirements.txt
RUN mkdir -p /opt/code
WORKDIR /opt/code
ADD supervisord.conf /etc/supervisord.conf
CMD supervisord -c /etc/supervisord.conf
urodoz / haproxy.cfg
Created Apr 14, 2017
Multiple SSL certificates in HAProxy configuration
View haproxy.cfg
maxconn 2048
mode http
timeout connect 5000ms
timeout client 90000ms
timeout server 90000ms
frontend secure-http-in
urodoz /
Created Sep 25, 2016
Django Null/Not null admin filter
from django.contrib.admin import SimpleListFilter
class NullListFilter(SimpleListFilter):
def lookups(self, request, model_admin):
return (
('1', 'Null',),
('0', '!= Null',),