Skip to content

Instantly share code, notes, and snippets.

Flávio Juvenal da Silva Junior fjsj

Block or report user

Report or block fjsj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fjsj
fjsj / speedtest.py
Created Jan 21, 2019
Python bloom filters performance test (based on pybloomfilter's own test)
View speedtest.py
#! /usr/bin/env python
import os
import tempfile
import time
import timeit
import pybloomfilter
tempfiles = []
@fjsj
fjsj / sorted_list_intersection.py
Created Dec 14, 2018
Python fast sorted list intersection
View sorted_list_intersection.py
import bisect
def bisect_index(arr, start, end, x):
i = bisect.bisect_left(arr, x, lo=start, hi=end)
if i != end and arr[i] == x:
return i
return -1
def exponential_search(arr, start, x):
if x == arr[start]:
@fjsj
fjsj / checklist-proposta-pybr.md
Last active Jun 15, 2018
Checklist para propostas de talks para Python Brasil
View checklist-proposta-pybr.md

Checklist para propostas de talks para Python Brasil

Tema

  • Escolhi um tema relevante para a audiência. Imaginei quem estará na conferência e pensei: "sobre o que essas pessoas querem/precisam ouvir?"
  • Escolhi um tema enriquecedor, que trará um novo aprendizado para minha audiência
  • Escolhi um tema que já me sinto confortável em falar ou terei tempo suficiente para estudar para me sentir confortável
  • Escolhi um tema que é possível apresentar em 35 minutos
  • Escolhi um único tema e não um conjunto de temas pouco relacionados

Texto da proposta

@fjsj
fjsj / talk-types.md
Last active Apr 21, 2018
PyCon and DjangoCon commonly accepted talk types (with examples)
View talk-types.md

Tutorial-like

Best/worst practices

@fjsj
fjsj / django-apps-common-structure.txt
Created Apr 2, 2017
Django apps common structure
View django-apps-common-structure.txt
my_app/
management/
migrations/
templates/
templatetags/
__init__.py
admin.py
apps.py
context_processors.py
exceptions.py
@fjsj
fjsj / has_missing_migrations.py
Last active May 21, 2017 — forked from nealtodd/gist:a8f87b0d95e73eb482c5
Django management command to detect missing migration files.
View has_missing_migrations.py
import sys
from django.apps import apps
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import connections
from django.db.migrations.autodetector import MigrationAutodetector
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.state import ProjectState
from django.db.utils import OperationalError
@fjsj
fjsj / dropzone-createThumbnailFromUrl-ios-fix.js
Created Sep 29, 2016
Dropzone monkey patch to fix iOS photo orientation bug
View dropzone-createThumbnailFromUrl-ios-fix.js
/* Start of monkey patch to fix iOS photo orientation bug.
See: https://github.com/enyo/dropzone/issues/46
Diff here: https://github.com/enyo/dropzone/issues/46#issuecomment-181849181 */
Dropzone.prototype.createThumbnailFromUrl = function(file, imageUrl, callback, crossOrigin) {
var img;
img = document.createElement("img");
if (crossOrigin) {
img.crossOrigin = crossOrigin;
}
img.onload = (function(_this) {
You can’t perform that action at this time.