Skip to content

Instantly share code, notes, and snippets.

Gonzalo Amadio gonzaloamadio

View GitHub Profile
@gonzaloamadio
gonzaloamadio / debugging_decorators.py
Last active Nov 5, 2019 — forked from chadgh/debugging_decorators.py
python decorators for; debugging, threading
View debugging_decorators.py
def timeit(function):
'''Decorator used for debugging. Prints the call and how long it took.'''
def timed(*args, **kwargs):
ts = time.time()
result = function(*args, **kwargs)
te = time.time()
print("{0} ({1}, {2}) {3:.2} sec"
.format(function.__name__, args, kwargs, te - ts))
View use_case.py
class CreateJob(UseCaseInterface):
def __init__(
self,
repository: JobRepositoryInterface,
title,
date_start,
date_end,
slug=None
):
self._title = title
@gonzaloamadio
gonzaloamadio / linux admin basic commands
Last active Jul 18, 2018
Various linux commands for administrators, and for everyone
View linux admin basic commands
--- Connect to windows via rdesktop ---
> rdesktop -u administrador -g1500x800 10.11.11.97
--- Connect to linux via ssh ---
> ssh {user}@{ip or dns-name}
Example
> ssh root@linux-server.domain.com
@gonzaloamadio
gonzaloamadio / .vimrc
Last active Jul 6, 2020
My ~/.vimrc configuration. Mostly oriented for python
View .vimrc
" # Fisa-vim-config
" # http://fisadev.github.io/fisa-vim-config/
" # version: 8.2
" https://realpython.com/vim-and-python-a-match-made-in-heaven/#vim-extensions
" # Other ref: https://nvie.com/posts/how-i-boosted-my-vim/
set encoding=utf-8
let using_neovim = has('nvim')
let using_vim = !using_neovim
View gist:764bb66febcab4a2c0f48f1791a62b13
########## LOGGIN
# Put this inside settings.py (if you have separated settings, put it on base setting)
# If DEBUG=True, all logs (including django logs) will be
# written to console and to debug_file.
# If DEBUG=False, logs with level INFO or higher will be
# saved to production_file.
You can’t perform that action at this time.