Skip to content

Instantly share code, notes, and snippets.

View luzfcb's full-sized avatar

Fábio C. Barrionuevo da Luz luzfcb

View GitHub Profile
@luzfcb
luzfcb / bobp-python.md
Created July 18, 2017 19:51 — forked from eltonplima/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

Guia das melhores das melhores práticas para Python

A versão original(em inglês) pode ser encontrada aqui

Um guia com as "melhores das melhores práticas" (BOBP) para o desenvolvimento em Python.

Geral

Valores

@luzfcb
luzfcb / README.md
Created July 6, 2017 20:14 — forked from hackebrot/README.md
Python class setup

Run pytest and show prints:

$ pytest -v -s
test_helloworld.py::TestHello::test_python [TestHello.setUpClass] PASSED
test_helloworld.py::TestHello::test_world PASSED
test_helloworld.py::TestHey::test_world [TestHey.setup_class] PASSED
@luzfcb
luzfcb / Ubuntu.colors
Created April 24, 2017 23:33 — forked from ar-lex/Ubuntu.colors
Ubuntu Colour Palette for KDE.
[ColorEffects:Disabled]
Color=56,56,56
ColorAmount=0
ColorEffect=0
ContrastAmount=0.65
ContrastEffect=1
IntensityAmount=0.1
IntensityEffect=2
[ColorEffects:Inactive]
@luzfcb
luzfcb / Ubuntu.colorscheme
Created April 24, 2017 23:31 — forked from ar-lex/Ubuntu.colorscheme
~/.kde/share/apps/konsole/Ubuntu.colorscheme - Ubuntu Color Scheme for Konsole.
[Background]
Color=48,10,36
MaxRandomHue=0
MaxRandomSaturation=0
MaxRandomValue=0
[BackgroundIntense]
Color=89,18,67
[Color0]
@luzfcb
luzfcb / clean_py.sh
Last active February 29, 2024 05:50 — forked from joelverhagen/clean_py.sh
Recursively removes all .pyc files and __pycache__ directories in the current directory
#!/bin/sh
# recursively removes all .pyc , .pyo files and __pycache__ directories in the current
# directory
find . | \
grep -E "(__pycache__|\.pyc$|\.pyo$)" | \
xargs rm -rf
# or, for copy-pasting:
@luzfcb
luzfcb / Forms_django.html
Created December 1, 2016 18:47 — forked from tiagoamx/Forms_django.html
Form Dinamico django horinzontal span6
{% if form.non_field_errors %}
<div class="alert alert-error">
{% for error in form.non_field_errors %}
{{error}}
{% endfor %}
</div>
{% endif %}
<form class="form-horizontal" action="{{ form_action }}" method="post"
enctype="multipart/form-data" id="form-novo-movimento" name="form-novo-movimento">
import argparse
# Set up the main parser
parser = argparse.ArgumentParser(description='An awesome program')
# And the subparser
subparsers = parser.add_subparsers(
title='subcommands',
description='valid subcommands',
help='additional help')
@luzfcb
luzfcb / estudo-yield.py
Created January 25, 2016 00:43 — forked from alexaleluia12/estudo-yield.py
yield python
# mais informações sobre yield generator/coroutine
# http://www.dabeaz.com/generators/
# motivação
# http://www.dabeaz.com/coroutines/Coroutines.pdf pg: 68
"""
>>> gen = foo1(lambda : [1,2,3,6,90])
// using jQuery
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
@luzfcb
luzfcb / django-angular-initial-config.js
Created January 20, 2016 00:04 — forked from n1lux/django-angular-initial-config.js
angular config interpolate and csrf token
var app = angular.module('app',['ngCookies', 'ui.bootstrap'],
// Change interpolation symbols
function ($interpolateProvider) {
$interpolateProvider.startSymbol('{$');
$interpolateProvider.endSymbol('$}');
});
app.config(['$httpProvider', function($httpProvider) {
// Change content type for POST so Django gets correct request object
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';