Skip to content

Instantly share code, notes, and snippets.

View ionatan-israel's full-sized avatar
🏠
Working from home

Jonatan Rodríguez ionatan-israel

🏠
Working from home
View GitHub Profile
@sockmonk
sockmonk / iterm2.md
Created October 3, 2011 16:44 — forked from chelmertz/iterm2.md
iterm2 cheatsheet
Function Shortcut
previous tab ⌘ + left arrow
next tab ⌘ + right arrow
go to tab ⌘ + number
go to window ⌘ + Option + Number
go to split pane by direction ⌘ + Option + arrow
go to split pane by order of use ⌘ + ] , ⌘ + [
split window horizontally (same profile) ⌘ + D
split window vertically (same profile) ⌘ + d
@maraujop
maraujop / forms.py
Created February 15, 2012 19:04
django-crispy-forms bootstrap form example
# -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
class MessageForm(forms.Form):
text_input = forms.CharField()
@jgarber
jgarber / MIT-LICENSE.txt
Created April 4, 2012 14:57
Responsive video
Copyright (c) 2011 ZURB, http://www.zurb.com/
@webdevotion
webdevotion / .bash_profile
Last active December 21, 2020 10:17
Fancy bash shell
# READ MORE HERE: http://www.webdevotion.be/blog/2012/06/06/terminal-git-branch-status-colored-icons
# ==============================================================================
# FANCY GIT STATUS ICONS
# ==============================================================================
# SOME VARIABLES in capitals
# no whitespace between variable names and = sign!
COLOR_RESET="\e[00m"
COLOR_GREEN="\e[1;32m"
COLOR_RED="\e[00;31m"
@uolot
uolot / gist:4171107
Last active June 19, 2016 17:25
Django named url RedirectView
# views.py
from django.views.generic import RedirectView
from django.core.urlresolvers import reverse
class NamedUrlRedirectView(RedirectView):
def __init__(self, url, *args, **kwargs):
self.url = reverse(url)
super(NamedUrlRedirectView, self).__init__(*args, **kwargs)
@Atem18
Atem18 / gist:4696071
Last active April 19, 2024 11:18 — forked from evildmp/gist:3094281
Tutorial to seting up a django website in production.

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
from os import path, pardir
import sys
PROJECT_ROOT = path.dirname(path.abspath(__file__))
sys.path.append(path.join("apps"))
DEBUG = True
##### PIPELINE ################################################################
import os
# Our django-pipeline settings
PATH_TO_HERE = os.getcwd()
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
PIPELINE_CSS = {
'standard': {
'source_filenames': (
@jackiekazil
jackiekazil / rounding_decimals.md
Last active January 17, 2024 12:29
How do I round to 2 decimals in python?

How do I round to 2 decimals?

In python, you have floats and decimals that can be rounded. If you care about the accuracy of rounding, use decimal type. If you use floats, you will have issues with accuracy.

All the examples use demical types, except for the original value, which is automatically casted as a float.

To set the context of what we are working with, let's start with an original value.

Original Value

@ionatan-israel
ionatan-israel / how_south.py
Last active August 29, 2015 14:01
Trabajando con South
"""
uso basico de south
"""
# GENERAR MIGRACIONES:
# si es una app nueva
./manage.py schemamigration aplication --initial
# si se realizan cambios, entonces
./manage.py schemamigration aplication --auto