Skip to content

Instantly share code, notes, and snippets.

Ezequiel Bertti ebertti

View GitHub Profile
View teste_generator.py
# 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 Dec 30, 2016
Smart label using, django-choices, django-suit (bootstrap2) and django-admin-easy
View code.py
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 Sep 2, 2016
oh-my-zsh with custom theme and plugins
View install.sh
#
# 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 Aug 5, 2016
Dreamhost with passenger+python forcing HTTPS redirect 301 on passenger_wsgi.py file
View passenger_wsgi.py
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 Aug 29, 2015
Como fazer o PopcornTime voltar a funcionar com ChromeCast
View PopcornChromecastComoResolver.md

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 Aug 29, 2015
AcharLinksEmCsv
View asd.py
# 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 Aug 29, 2015
Mira - Europeana
View abstract.js
var abstract = [{
name: 'topic',
widgets : [
{name: 'header', children:[
{name: 'logo'},
{name: 'search_form', children:[
{name: 'search_group', children:[
{name: 'search_field'},
{name:'search_button'}
]
View xml_fixed.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 -->
You can’t perform that action at this time.