Skip to content

Instantly share code, notes, and snippets.

View alexandre's full-sized avatar
🎯
Focusing

Alexandre Souza alexandre

🎯
Focusing
View GitHub Profile
@alexandre
alexandre / spacy_4fun.py
Last active August 9, 2018 13:44
A ideia era montar uma tabela verdade, mas eu preciso dormir...
# https://spacy.io/
# pip install spacy
#
#
import collections
import spacy
nlp = spacy.load('pt')
@alexandre
alexandre / 0x41e.asc
Last active July 2, 2018 19:29
If you know me, you'll find some way to get the fingerprint...
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFs6aQQBEADK7ElPNta49gNS5FTpU5jSjJ8+I4JkjclBi30ApBiAWopJGFP4
Jd++bsF2615Zi77oGpLOBiGvskPgaHTZ3Ox9byrBCmgDUglRf4MG06m9pUMcJfei
9BZIPE0syZyOxix9eNUGIB9Jxbi477MiM+g8yclxvSAL6uKxxc6cWPlrS5mgP2Qe
EsZuoGUc8J8od0RLBBIDHwbqESsdS0otIaYXxdIzXpoBofNIvyR+I70Nd9zBFalM
ur8vgmfvA6tsZJQLZI1066yaB1FZLdyFalSfTISqbcch6F+SEAJ8kWJKQKDxHAkw
HmNeiy9HypwvFMYC5/mshfa9zxkAP45HYRT7HfmtQmbSGl0AQpYFlf71eNr8qDys
oiQJ58ejcstyg+r6Dop7MAdZFLOTM2iOA0x5rw+klNWkq3c+f7qfva2G/cSuYfb8
MZeFl6gCAyZkLXkOhAYd73QX7+EH+oAXTwkryeiwoQ8L8F/ApNmpuPQ//R/j/UNS
@alexandre
alexandre / learn_path.md
Last active December 9, 2023 23:13
Um guia para estudar python do básico ao intermediário (meu nível) utilizando alguns livros e outros recursos
@alexandre
alexandre / System Design.md
Created February 23, 2018 19:28 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@alexandre
alexandre / force_decorator.py
Created December 9, 2016 21:00
Forcing a decorator even when it is overridden.
from __future__ import print_function
import functools
from inspect import isfunction
def decorator_with_trace(force_super):
def wrapper(function):
@alexandre
alexandre / set1.rkt
Created November 28, 2016 16:07
Racket and cryptopals
#lang racket
;; Set 1 - Challenge 1
;; TODO: split string in pairs and convert one by one to int and lookup into ascii table the related character.
(define the-string "49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d")
(define (split-in-pairs a-list)
(cond
[(null? a-list) a-list]
[(<= (length a-list) 2) (cons a-list '())]
from pyramid.exc import HTTPMethodNotAllowed
from pyramid.view import view_config
class BaseView(object):
def __init__(self, request):
self.request = request
def __call__(self):
from sqlalchemy.sql import expression
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.types import Date, DateTime
class DateBetween(expression.FunctionElement):
type = Date
name = 'datebetween'
@alexandre
alexandre / download_censo_2010_statistical_data.rkt
Created June 28, 2016 07:06
script para baixar arquivos com fins estatisticos do censo 2010
#lang racket
(require racket/system)
(require net/ftp)
(define conn (ftp-establish-connection "ftp.ibge.gov.br"
21
"anonymous"
""))

Algo que eu descobri durante um teste....

from pymongo import MongoClient


client = MongoClient()

db = client.test_database

expected_doc = {