Skip to content

Instantly share code, notes, and snippets.

View luanfonceca's full-sized avatar

Luan Fonseca luanfonceca

View GitHub Profile
@shymonk
shymonk / customize-save-in-django-admin-inline-form.org
Last active April 14, 2024 02:55
How to customize save in django admin inline form?

Customize Save In Django Admin Inline Form

Background

This is a common case in django ORM.

from django.db import models

class Author(models.Model):
@garbados
garbados / gist:f82604ea639e0e47bf44
Created July 27, 2014 23:07
Falsehoods Programmers Believe About Gender
  1. There are two and only two genders.
  2. Okay, then there are two and only two biological genders.
  3. Gender is determined solely by biology.
  4. Okay, it’s mostly determined by biology, right?
  5. Please tell me it’s determined by DNA.
  6. Gender can be reliably determined through visual means. After all, no man would ever wear a burka.
  7. Once gender is set, it never changes.
  8. Even if the gender can change, it will only change from the one value to the other value.
  9. Only one gender can be “active” at the same time.
  10. We’re tracking gender now, so we’ve always tracked it.
@renatooliveira
renatooliveira / fabfile.py
Last active September 1, 2017 14:02
Minha configuração atual de deploy, usada no projeto http://mobdoctor.me Otimizações são bem vindas :)
# coding: utf-8
from fabric.api import env, cd, run, sudo
from fabric.contrib.files import exists
from fabric.colors import green
from config import (HOST, USER, PASSWORD, APP_DIR,
ENV_HOME, PROJECT_NAME, VIRTUALENVS, REPOSITORY, BRANCH)
env.hosts = [HOST]
env.user = USER
@danilobellini
danilobellini / t9.py
Created September 12, 2012 18:24
T9 Message to cell phone numbers to be pressed
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 11 20:48:25 2012
T9 Message to cell phone numbers to be pressed
Problem description:
http://dojopuzzles.com/problemas/exibe/escrevendo-no-celular/