Skip to content

Instantly share code, notes, and snippets.

View igr-santos's full-sized avatar

Igor dos Santos igr-santos

  • Belo Horizonte - MG
View GitHub Profile

Restore dump for docker-compose:

docker exec -i [service_name] psql postgres://postgres:3x4mpl3@localhost:5432/bonde < [file_name]

Inserir tags:

insert into tags ("name", "label") values ('user_meio-ambiente', 'Meio Ambiente'), ('user_direitos-humanos', 'Direitos Humanos'),
@igr-santos
igr-santos / Create-react-app-with-ava.md
Last active May 4, 2018 12:59
Um guia para uso do AVA como test runner de projetos com Create React APP
@igr-santos
igr-santos / catarse.rst
Last active May 6, 2016 16:59
Documento tem como objetivo montar a campanha para crowdfunding

Campanha Python Sudeste 2016

Esse documento tem como objetivo montar a campanha para organizarmos as finanças e recompensas do evento Python Sudeste 2016, no modelo de crowdfunding, utilizando a ferramenta do Catarse

TODO

#!/usr/bin/env python
# coding: utf-8
# import time
import serial
from decouple import config
from tweepy import OAuthHandler, StreamListener, Stream
DEVICE = '/dev/ttyACM0'
BAUD_RATE = 9600
/*
LiquidCrystal Library - Hello World
Demonstrando o uso de um display LCD 16x2. A biblioteca LiquidCrystal
funciona com todos os displays LCD que forem compativeis com o driver
Hitachi HD44780.
Esse programa imprime "Hello World!" no LCD
O circuito:
- LCD RS: digital 12
@igr-santos
igr-santos / Preferences.sublime-settings
Last active August 29, 2015 14:13
Configure Sublime Text 3
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/SublimeLinter/Perv Orange Moonlight (SL).tmTheme",
"draw_minimap_border": true,
"enable_telemetry": false,
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
@igr-santos
igr-santos / teste.py
Created August 22, 2014 16:55
example use Django Rest Framework
# serializers.py
class ObjectiveSerializer(serializers.ModelSerializer):
class Meta:
model = Objective
fields = (
'name', 'short_description', 'points_awarded',
'number_of_steps', 'energy_cost'
)
@igr-santos
igr-santos / configurando-servidor-gunicorn.md
Last active August 29, 2015 14:04
configurando servidor com Django + Gunicorn

Title: Configurando um servidor de produção para aplicações Python Slug: configurando-um-servidor-de-producao-para-aplicacoes-python Date: 2014-07-24 14:42 Tags: django,web,tutorial,wsgi,gunicorn,nginx,supervisor,servidor,producao Author: Igor Santos Email: [email protected] Github: igr-santos Bitbucket: igrsantos Site: http://pythonclub.com.br Gittip: igr-santos

@igr-santos
igr-santos / console.py
Created July 7, 2014 17:06
Comportamento interessante de se observar
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo(object):
... x = 9
... def __init__(self, x):
... self.x = x
... def bar(self, y):
... return self.x + y
...
@igr-santos
igr-santos / mongo_manager_example.py
Created July 3, 2014 19:46
Example execute MongoManager
if __name__ == '__main__':
from mongo_queryset import MongoManager, InQuery, DateQuery
manager = MongoManager('cybergia', 'reportlab_userdocument')
date_gt = datetime(2014, 01, 01)
date_lte = datetime.today()
manager.project(
user_pk=1, predicates__predicate=1, predicates__obj=1,
predicates__date=1
).unwind(