Skip to content

Instantly share code, notes, and snippets.

View marcosgabarda's full-sized avatar
coffee?

Marcos Gabarda marcosgabarda

coffee?
View GitHub Profile
import random
from django import forms
class ShrugForm(forms.Form):
def clean(self):
super().clean()
if random.choice([True, False]):

Keybase proof

I hereby claim:

  • I am marcosgabarda on github.
  • I am marcosgabarda (https://keybase.io/marcosgabarda) on keybase.
  • I have a public key ASD1F997Nry4KGFvXSNN5cdCwdkh8dqPw_Qkr6PerGO0-Ao

To claim this, I am signing this object:

# Gist to save my atom settings
$ apm install sync-settings
@marcosgabarda
marcosgabarda / .editorconfig
Created August 25, 2016 10:55
My configuration for code editors
# http://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
import sys
try:
from django.conf import settings
from django.test.utils import get_runner
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
# -*- coding: utf-8 -*-
"""Version code adopted from Django development version.
https://github.com/django/django
"""
from __future__ import unicode_literals
import datetime
import os
import subprocess
@marcosgabarda
marcosgabarda / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# This file contains the WSGI configuration required to serve up your
# web application at http://cuble.pythonanywhere.com/
# It works by setting the variable 'application' to a WSGI handler of some
# description.
#
# Below are templates for Django and Flask. You should update the file
# appropriately for the web framework you're using, and then
# click the 'Reload /yourdomain.com/' button on the 'Web' tab to make your site
# live.
from PIL import Image
def random_image(size=(200, 200)):
""" Generates a random PIL image, for testings propouse.
:param size: Size of the random image generated.
"""
color = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255), 0)
return Image.new("RGBA", size, color)
# -*- coding: utf-8 -*-
"""Storages for split media and static in different folders."""
import storages.backends.s3boto
class StaticRootS3BotoStorage(storages.backends.s3boto.S3BotoStorage):
"""Storage for save all static files in static folder."""
def __init__(self, *args, **kwargs):
"""Overrides and define location in "static".