Skip to content

Instantly share code, notes, and snippets.

View hbruno's full-sized avatar

Hernan Bruno hbruno

  • Crosschq
  • Mar del Plata
View GitHub Profile
@hbruno
hbruno / Dockerfile
Created January 24, 2023 13:53 — forked from nolram/Dockerfile
Docker-compose: Django + Postgis + RabbitMQ + Celery + Redis
FROM python:3.5
MAINTAINER Marlon Baptista de Quadros(marlonbaptista@hotmail.com)
ENV PYTHONUNBUFFERED 1
RUN apt-get update -y
RUN apt-get -y install binutils libproj-dev gdal-bin postgresql-client python3-lxml
RUN apt-get -y install libmemcached-dev
MODELOS
# Basico, los campos conocidos y un json con TODO lo demás, cada cliente tiene su propia definicion.
class ModelA:
created_at
amount
metadata = JSON_FIELD
# Semantico, cada cliente define que significa cada campo para el,
# por ej el field_int_1 es la cantidad de transacciones.
@hbruno
hbruno / vimrc
Last active December 30, 2019 10:20
VIM config
" https://realpython.com/vim-and-python-a-match-made-in-heaven/
set nocompatible " required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
extension OSLog {
private static var subsystem = Bundle.main.bundleIdentifier!
static let ui = OSLog(subsystem: subsystem, category: "UI")
static let network = OSLog(subsystem: subsystem, category: "Network")
}
os_log("Contact selected", log: .ui)
os_log("HTTP response: %@", log: .network, responseCode)
@hbruno
hbruno / settings.py
Created March 6, 2018 16:48
Logging configuration
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s '
'%(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(asctime)s %(module)s %(message)s'
@hbruno
hbruno / test_command.py
Created March 6, 2018 16:18
Progress and logging django command
from django.core.management.base import BaseCommand
from tqdm import trange
from random import random, randint
from time import sleep
import logging
logger = logging.getLogger('commands') # or __name__
class Command(BaseCommand):
"""
prices_block = [
{
name: 'Destacados',
categories: ['featured']
},
{
name: 'Promociones',
categories: ['2x1', '3x1', '4x1']
},
{