Skip to content

Instantly share code, notes, and snippets.

Adrián Matellanes amatellanes

  • Málaga, Spain
Block or report user

Report or block amatellanes

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
amatellanes / .hg_check_issue_id
Created Mar 24, 2019
Check that a commit comment mentions the current branch name (potentially tracking issue ID)
View .hg_check_issue_id
#!/usr/bin/env bash
HG_COMMIT_MESSAGE="$(hg tip --template {desc})"
HG_BRANCH="$(hg identify -b)"
if [[ ${HG_COMMIT_MESSAGE=} = *${HG_BRANCH}* ]]; then
exit 0
exit 1
amatellanes /
Created Jan 6, 2016
Pip Upgrade All Outdated Python Packages
pip list --outdated | awk '{print $1}' | xargs pip install -U
amatellanes /
Created Sep 19, 2015
Remove apps from Launchpad in Mac OS X 10.10 (Yosemite)
sqlite3 $(sudo find /private/var/folders -name "DELETE FROM apps WHERE title='APPNAME';" && killall Dock
amatellanes / disable_wireless
Created Nov 2, 2014
Disable permantly wireless connection in Linux.
View disable_wireless
# Add next line to `/etc/network/interfaces`
iface wlan0 inet manual
# Restart NetworkManager
$ sudo service network-manager restart
amatellanes /
Last active Feb 19, 2020
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
Queue('default', routing_key='tasks.#'),
amatellanes /
Last active Feb 10, 2020
Useful py.test commands.
py.test --collect-only # collects information test suite
py.test -v # outputs verbose messages
py.test -q # omit filename output
python -m pytest -q # calling pytest through python
py.test --markers # show available markers
amatellanes /
Last active Dec 5, 2019
Fibonnaci series by using threading module in Python.
import threading
from Queue import Queue
fibo_dict = {}
shared_queue = Queue()
input_list = [3, 10, 5, 7]
queue_condition = threading.Condition()
amatellanes /
Last active Aug 29, 2015
Configure Elasticsearch to run at startup
# Add the service to the automatic startup system. For further detail look at the man page
# for update-rc.d by typing the command man update-rc.d
sudo update-rc.d eleasticsearch defaults
amatellanes /
Created Jul 20, 2014
Create tarball and zipball from a repo using git.
git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip >git-1.4.0.tar.gz # Create a compressed tarball for v1.4.0 release.
git archive --format=zip --prefix=git-1.4.0/ v1.4.0 > # Create a compressed zipball for v1.4.0 release.
amatellanes / Configure Spanish keyboard on Ubuntu
Created Jun 6, 2014
Configure Spanish keyboard on Ubuntu.
View Configure Spanish keyboard on Ubuntu
# Fast method. Run next command on terminal
sudo setxkbmap -layout 'es,es' -model pc105
# Modify /etc/X11/xorg.conf file
Section “InputDevice”
Identifier “Generic Keyboard”
Driver “kbd”
Option “CoreKeyboard”
Option “XkbRules” “xorg”
Option “XkbModel” “pc105″
You can’t perform that action at this time.