Skip to content

Instantly share code, notes, and snippets.

View turicas's full-sized avatar

Álvaro Justen turicas

View GitHub Profile
[extensions]
extdiff =
fetch =
rebase =
mq =
histedit = /usr/bin/histedit.py
pager =
transplant =
graphlog =
bookmarks =
@maurobaraldi
maurobaraldi / .gitconfig
Created November 6, 2011 23:37 — forked from tomster/.gitconfig
An example git configuration including convenience aliases, some saner default behavior, a neat shell prompt and tab completion that can display the name of the tracking remote
# ~/.gitconfig
[branch]
autosetupmerge = true
[push]
default = current
[core]
excludesfile = .gitignore
@rodrigopinto
rodrigopinto / grbc_horaextra_2012.beer
Created January 21, 2012 22:25
Samba enredo 2012 do G.R.B.C #horaextra
Hojeee é mais uma segunda-feira,
a patroa ta avisada,
não tenho hora pra voltar.
Vou pro bar com amigos,
Entre uma cerveja e outra,
não vejo a hora passar
Conversa nerd, filosófica ou afiada
o que importa é a cervejada
@flavioamieiro
flavioamieiro / CR2JPEG.sh
Created November 17, 2012 22:23
Extrair JPEG do header de um arquivo raw da Canon (CR2)
#!/bin/bash
find . -name '*.CR2' -print0 | while read -r -d '' FILE
do
BASENAME=$(basename -s ".CR2" "$FILE")
exiftool -b -previewImage -ext .CR2 -w .JPG "$FILE"
exiftool -tagsFromFile "$FILE" "$BASENAME".JPG
done
@perone
perone / time_dict_value_max.py
Created December 4, 2012 00:31
Python max dict value
import timeit
t = timeit.Timer("v=sorted(d.items(), key=lambda x: x[1])[-1]",
"d = {'a': 1000, 'b': 3000, 'c':100}")
print t.timeit()
# 1.648s
t = timeit.Timer("v=max(d.iteritems(), key = operator.itemgetter(1))[0]",
"import operator; d = {'a': 1000, 'b': 3000, 'c':100}")
print t.timeit()
# projectfoo/config/__init__.py
from os import path
ROOT_PATH = path.dirname(path.dirname(path.abspath(__file__)))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
@ferd
ferd / app_deps.erl
Created September 23, 2012 05:33
Quick escript to generate a visualization of app dependencies in Erlang/OTP.
%%% Run with 'escript app_deps.erl'
%%% Change the path in filelib:wildcard/1 as required to capture all
%%% your dependencies.
%%%
%%% Rectangular nodes will represent library apps (no processes involved)
%%% and the circular nodes will represent regular apps. An arrow going from
%%% 'A -> B' means 'A depends on B'.
%%%
%%% This script depends on graphviz being present on the system.
-module(app_deps).
@maxpert
maxpert / piratebay_index.py
Created September 25, 2012 13:14
Quick and dirty Whoosh Redis storage
"""
Copyright (c) 2012 Zohaib Sibte Hassan
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
anonymous
anonymous / gist:156623
Created July 27, 2009 16:41
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._
@tmcw
tmcw / README.md
Created October 31, 2012 15:00
GIS with Python, Shapely, and Fiona Example 1 - CSV Files