Skip to content

Instantly share code, notes, and snippets.

View ebertti's full-sized avatar

Ezequiel Bertti ebertti

View GitHub Profile
# antes de executar este código, tente adivinhar a ordem dos prints em cada cenário
def gerador(qtd):
print('10 antes')
for i in range(qtd):
print('20 para cada', i)
yield i * 10
def normal(qtd):
print('10 antes')
@ebertti
ebertti / code.py
Last active December 30, 2016 22:01
Smart label using, django-choices, django-suit (bootstrap2) and django-admin-easy
class Kind(DjangoChoices):
Default = C(value='default')
Success = C(value='success')
Warning = C(value='warning')
Important = C(value='important')
Info = C(value='info')
Inverse = C(value='inverse')
class CK(ChoiceItem):
@ebertti
ebertti / install.sh
Last active September 2, 2016 18:06
oh-my-zsh with custom theme and plugins
#
# to run replate _URL_ for the url on RAW button
# sh -c "$(curl -fsSL _URL_)"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
sed -i -- 's/robbyrussell/juanghurtado/g' ~/.zshrc
sed -i -- 's/(git)/(git python pyenv pip)/g' ~/.zshrc
@ebertti
ebertti / passenger_wsgi.py
Created August 5, 2016 22:11
Dreamhost with passenger+python forcing HTTPS redirect 301 on passenger_wsgi.py file
import sys, os
sys.path.append(os.getcwd())
os.environ['DJANGO_SETTINGS_MODULE'] = "my_project_name.settings"
### OLD DJANGO like 1.3
import django.core.handlers.wsgi
wsgi_application = django.core.handlers.wsgi.WSGIHandler()
### new django versions
from django.core.wsgi import get_wsgi_application
@ebertti
ebertti / PopcornChromecastComoResolver.md
Last active August 29, 2015 14:23
Como fazer o PopcornTime voltar a funcionar com ChromeCast

Eu estava tendo esse problemas e achei uma solução, para quem quiser corrigir, segue a solução.

Path do arquivo para correção no Windows:

%LOCALAPPDATA%\Popcorn Time\node_modules\chromecast-js\pt-media-receiver.js

Alterar a linha 7 DE:

 PopcornStyledMediaReceiver.APP_ID = '887D0748';
@ebertti
ebertti / asd.py
Last active August 29, 2015 14:20
AcharLinksEmCsv
# coding: utf-8
import csv
import sys
import re
def main():
regra = re.compile(r'http://www.megamamute.com.br/produto/.*')
selecionados = set()
@ebertti
ebertti / abstract.js
Last active August 29, 2015 14:20
Mira - Europeana
var abstract = [{
name: 'topic',
widgets : [
{name: 'header', children:[
{name: 'logo'},
{name: 'search_form', children:[
{name: 'search_group', children:[
{name: 'search_field'},
{name:'search_button'}
]
@ebertti
ebertti / xml_fixed.xml
Created August 2, 2012 22:36
Sample of xml
<!-- just a sample of xml FIXED -->
<brand>
<code type="null"/>
<name>Intel</nome_produto>
<products type="list">
<product> <!-- my fix is here -->
<price type="null"/>
<model>Core 2 Duo</model>
<disponibilidade type="boolean">False</disponibilidade>
</product> <!-- my fix is here -->