Skip to content

Instantly share code, notes, and snippets.

Avatar
🧩
Focusing

agustín méndez matagus

🧩
Focusing
View GitHub Profile
@matagus
matagus / tasks.py
Last active Mar 9, 2016
Task base class for Spotify's Luigi framework to force a task to clean-up its outputs, ie reset and re-run a task. Credits to https://github.com/spotify/luigi/issues/595#issuecomment-194323344
View tasks.py
import luigi
class ForceableTask(luigi.Task):
force = luigi.BoolParameter(significant=False, default=False)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# To force execution, we just remove all outputs before `complete()` is called
@matagus
matagus / 0-intro.md
Created Mar 1, 2016
Controling luigid (Luigi daemon) using supervisord.
View 0-intro.md
  • create a user called luigid.
  • create /home/luigid/logs directory. luigid user must have write permissions.
  • copy luigi-daemon.conf to /etc/supervisor/conf/
  • sudo supervisorctl update
  • check that luigid is running (ps ax | grep luigid)
@matagus
matagus / countryinfo.py
Created Feb 11, 2016 — forked from pamelafox/countryinfo.py
Python list of country codes, names, continents, capitals, and pytz timezones
View countryinfo.py
countries = [
{'timezones': ['Europe/Andorra'], 'code': 'AD', 'continent': 'Europe', 'name': 'Andorra', 'capital': 'Andorra la Vella'},
{'timezones': ['Asia/Kabul'], 'code': 'AF', 'continent': 'Asia', 'name': 'Afghanistan', 'capital': 'Kabul'},
{'timezones': ['America/Antigua'], 'code': 'AG', 'continent': 'North America', 'name': 'Antigua and Barbuda', 'capital': "St. John's"},
{'timezones': ['Europe/Tirane'], 'code': 'AL', 'continent': 'Europe', 'name': 'Albania', 'capital': 'Tirana'},
{'timezones': ['Asia/Yerevan'], 'code': 'AM', 'continent': 'Asia', 'name': 'Armenia', 'capital': 'Yerevan'},
{'timezones': ['Africa/Luanda'], 'code': 'AO', 'continent': 'Africa', 'name': 'Angola', 'capital': 'Luanda'},
{'timezones': ['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuai
@matagus
matagus / index.html
Created Nov 14, 2015
Firefox Add-on installation page
View index.html
<script type="application/javascript">
<!--
function install (aEvent)
{
for (var a = aEvent.target; a.href === undefined;) a = a.parentNode;
var params = {
"Foo": { URL: aEvent.target.href,
IconURL: aEvent.target.getAttribute("iconURL"),
Hash: aEvent.target.getAttribute("hash"),
toString: function () { return this.URL; }
@matagus
matagus / .gitconfig
Last active Feb 15, 2016
My .gitconfig with a lot of aliases 👽
View .gitconfig
[user]
name = matagus
email = me@matagus.com
[color]
ui = auto
[color "status"]
added = cyan
changed = green
@matagus
matagus / .vimrc
Last active Apr 3, 2018
My current .vimrc file. Using vim-bundle, with support for Python, Django, Markdown, HTML, Javascript, Scala, node.js and CSS.
View .vimrc
" disable vi compatibility
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle
Bundle 'gmarik/vundle'
@matagus
matagus / SourceCodeSearchEngines.md
Created Oct 7, 2015 — forked from phillipalexander/SourceCodeSearchEngines.md
Source Code Search Engines You Can Use For Programming Projects
View SourceCodeSearchEngines.md

Source Code Search Engines

NOTE: This list is almost entirely copy/pasted from THIS awesome article. I've made my own personal edits (adding some additional content) which is why I keep it here.

MeanPath

Every day meanpath crawls over 200 million websites capturing the visible text, HTML source code, CSS and Javascript. This information is used by many companies to monitor the growth of web facing technology.

Ohloh

@matagus
matagus / APIs-webliography.md
Last active Mar 12, 2018
Links to posts, talks and slides talking about API design, arquitecture, testing, tools, etc
@matagus
matagus / favorite.js
Created Sep 23, 2014
favorite.js for django-favit with support for dynamic items added at any time
View favorite.js
$(document).ready(function() {
$(".endless_container").on("click", ".btn.favorite", function() {
var $obj = $(this);
var target_id = $obj.attr('id').split('_')[1];
$obj.prop('disabled', true);
$.ajax({
url: $obj.attr('href'),
type: 'POST',
data: {target_model: $obj.attr('model'),
target_object_id: target_id},
@matagus
matagus / vimrc
Last active Aug 29, 2015
vim config using vim-bundle (vundle)
View vimrc
" disable vi compatibility
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle
Bundle 'gmarik/vundle'