$ sudo aptitude install build-essential libpq-dev git git-core python-dev python-virtualenv python-pip
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
class bcolors: | |
OK = '\033[92m' | |
WARNING = '\033[93m' | |
FAIL = '\033[91m' | |
ENDC = '\033[0m' | |
# print bcolors.FAIL + 'Oops' + bcolors.ENDC |
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
leroy@squirtle666 ~/Code/portal-bonitoway/bonitoway/business/eventos on staging! | |
± % python runtests.py evento.tests.feature_tests !5487 | |
nosetests evento.tests.feature_tests --with-yanc --verbosity=2 -x -d | |
Deve exibir a listagem de Eventos contendo o Evento: Oktuberfest ... ok | |
---------------------------------------------------------------------- | |
Ran 1 test in 37.652s | |
OK |
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
class MessagesController < ApplicationController | |
require_role "relatorio", :for => :index | |
before_filter :login_required | |
before_filter :set_search_params, :only => [:index,:export] | |
before_filter :set_headers , :only => :export | |
# GET /messages | |
# GET /messages.xml | |
def index | |
if params[:search_old] |
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
""" | |
Imagine a seguinte estrutura: | |
/src | |
therapy.py | |
/therapy | |
queue.py | |
""" | |
# therapy/queue.py | |
def some_cool_api(my_string): |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
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
{% load webmedia_tags %} | |
{% if object_list %} | |
{% for obj in object_list %} | |
<div class="wd entry mf-300200-300 {{ obj.category|slugify }}"> | |
<h5 class="deck" >{% if obj.deck %}{{ obj.deck }}{% else %}{{obj.category}}{% endif %}</h5> | |
<a href="{{ obj.get_se_url }}">{% embed obj.get_image.url width=300 height=200 %}</a> | |
<h3> | |
<a href="{{ obj.get_se_url }}"> | |
<strong>{{ obj.title }}<span class="{{ obj.get_media_icon }}"></span></strong> | |
</a> |
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
# urls.py | |
urlpatterns = patterns('', | |
url('^galerias/$', | |
active_generic_view, | |
{'view': object_list, 'model': MediaCenter, 'paginate_by': 20}, | |
name='webmedia_mediacenter_list'), | |
url(r'^(?P<category_slug>[-\w]+)/galerias/$', 'mediacenter_category_list', | |
name='webmedia_mediacenters_category_list'), |
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
Leonardo S. - sexta / domingo (manhã) - PR | |
Marcelo Cajueiro - sexta / sábado (noite) - SC | |
Tomas D'Stefano - sexta / domingo (noite) - SP (à confirmar) | |
Ricardo Henrique - sexta / domingo (manhã) - MG | |
Romulo - sexta / domingo (manhã) - MG | |
Rondinelly - sexta / domingo (manhã) - MG | |
Gabriel Sobrinho - sexta / domingo (tarde) - MG | |
Adilson Carvalho - sexta / domingo (manhã) - PR | |
Igor Leroy - sexta / domingo (noite) - PR | |
Luiz - sexta / domingo (noite) - PR (à confirmar) |
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
site = Site.objects.get_current() | |
absolute_url = 'http://%s%s' % (site.domain, | |
instance.get_absolute_url()) | |
instance.short_url = vamu_url_shortening(absolute_url) | |
def vamu_url_shortening(url): | |
url = urllib2.quote(url, safe='') | |
vamu_api = 'http://va.mu/api/create/?url=%s' % (url) | |
response = urllib2.urlopen(vamu_api).read() |
NewerOlder