Skip to content

Instantly share code, notes, and snippets.

View matagus's full-sized avatar
🐿️
I miss the old Github activity stream

Matías Agustín Méndez matagus

🐿️
I miss the old Github activity stream
View GitHub Profile
@matagus
matagus / config
Created October 27, 2009 14:21
svn config file
### This file configures various client-side behaviors.
###
### The commented-out examples below are intended to demonstrate
### how to use this file.
### Section for authentication and authorization customizations.
[auth]
### Set store-passwords to 'no' to avoid storing passwords in the
### auth/ area of your config directory. It defaults to 'yes'.
### Note that this option only prevents saving of *new* passwords;
@matagus
matagus / trying exaile src code
Created February 10, 2010 20:07
how to get unique artists and albums in exaile 0.3.1 beta
In [88]: from xl import collection, xdg
In [89]: c = collection.Collection("Collection", location=os.path.join(xdg.get_data_dirs()[0], 'music.db'))
In [90]: from xl.trax.track import Track
In [91]: albums = set()
In [92]: artists = set()
"""Build an .xls file with all background colors vs patterns possibilities"""
import xlwt
wb = xlwt.Workbook()
ws = wb.add_sheet("Colors")
ws.write(0, 0, "Colors/Patterns")
for pat_index in range(0, 16):
ws.write(0, pat_index + 1, str(pat_index))
"""List of named colors from http://cloford.com/resources/colours/namedcol.htm"""
colors = [u'#FFB6C1', u'#FFC0CB', u'#DC143C', u'#FFF0F5', u'#DB7093', u'#FF69B4', u'#FF1493', u'#C71585',
u'#DA70D6', u'#D8BFD8', u'#DDA0DD', u'#EE82EE', u'#FF00FF', u'#FF00FF', u'#8B008B', u'#800080',
u'#BA55D3', u'#9400D3', u'#9932CC', u'#4B0082', u'#8A2BE2', u'#9370DB', u'#7B68EE', u'#6A5ACD',
u'#483D8B', u'#F8F8FF', u'#E6E6FA', u'#0000FF', u'#0000CD', u'#00008B', u'#000080', u'#191970',
u'#4169E1', u'#6495ED', u'#B0C4DE', u'#778899', u'#708090', u'#1E90FF', u'#F0F8FF', u'#4682B4',
u'#87CEFA', u'#87CEEB', u'#00BFFF', u'#ADD8E6', u'#B0E0E6', u'#5F9EA0', u'#00CED1', u'#F0FFFF',
u'#E0FFFF', u'#AFEEEE', u'#00FFFF', u'#00FFFF', u'#008B8B', u'#008080', u'#2F4F4F', u'#48D1CC',
u'#20B2AA', u'#40E0D0', u'#7FFFD4', u'#66CDAA', u'#00FA9A', u'#F5FFFA', u'#00FF7F', u'#3CB371',
@matagus
matagus / hgrc
Created June 9, 2010 13:34
colorize your hg output <3
[extensions]
# enable color extension
color =
# enable extdiff extension (Extended Diff)
hgext.extdiff =
[extdiff]
# configure extended diff to use colordiff (requires colordiff installed in your system)
cmd.cdiff = colordiff
opts.cdiff = -uprN
#!/usr/bin/python
from mercurial import util
import re
def check_references(*args, **kwargs):
"""
Checks that commit message contains a reference to or closes an issue.
Useful when using Redmine.
Usage in .hgrc:
@matagus
matagus / .bashrc
Created September 15, 2010 19:47
cool bash prompt configuration
MYCOLOR1="\[\033[1;32m\]"
MYCOLOR2="\[\033[1;34m\]"
MYCOLOR3="\[\033[1;37m\]"
MYCOLOR4="\[\033[1;32m\]"
export PS1="$MYCOLOR1\u$MYCOLOR2|$MYCOLOR3\h $MYCOLOR2\w $MYCOLOR4> \[\033[00m\]"
esto en /root/.bashrc:
@matagus
matagus / conf.py
Created October 16, 2010 22:12
django sttings proxy
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from django.conf import settings as django_settings
class SettingsProxy(object):
def __init__(self, settings, defaults):
self.settings = settings
self.defaults = defaults
@matagus
matagus / statslogger.py
Created October 29, 2010 02:43
logbook + json + filehandler for django
# -*- coding: utf-8 -*-
import os
from logbook import Logger, TimedRotatingFileHandler
from logbook.queues import ThreadedWrapperHandler
from django.conf import settings
from django.core.serializers.json import simplejson