This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Search on the current directory a matching file | |
# Find all files containing the args | |
# Usage: ff sample | |
function ff() { | |
find . -print |grep -i "$@" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Applies ellipsis to the text container */ | |
.text-elipsis { | |
overflow: hidden; | |
text-overflow: ellipsis; | |
white-space: nowrap; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:7.9.0 | |
MAINTAINER Albert Lacarta <[email protected]> | |
RUN npm install -g [email protected] && \ | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:2.7.13 | |
MAINTAINER Albert Lacarta <[email protected]> | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
maxconn 2048 | |
defaults | |
mode http | |
timeout connect 5000ms | |
timeout client 90000ms | |
timeout server 90000ms | |
frontend secure-http-in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.admin import SimpleListFilter | |
class NullListFilter(SimpleListFilter): | |
def lookups(self, request, model_admin): | |
return ( | |
('1', 'Null',), | |
('0', '!= Null',), | |
) |
NewerOlder