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
@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
@ionatan-israel
ionatan-israel / sentry.conf
Created May 30, 2014 20:56
Supervisor:: Configuración correr Sentry como un servicio.
[program:centinela]
command=/home/sentry/.virtualenvs/sentry/bin/sentry start http
environment=PATH="/home/sentry/.virtualenvs/sentry/bin"
directory=/home/sentry/
user=sentry
autostart=true
autorestart=true
redirect_stderr=true
// JavaScript Document
// Función para recoger los datos de PHP según el navegador, se usa siempre.
function objetoAjax(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
@ionatan-israel
ionatan-israel / print.css
Last active August 29, 2015 14:03
Hoja de Estilos base para imprimir (Size Letter)
@font-face {
font-family: 'Cambria';
src: url('fonts/Cambria.eot');
src: local('☺'),
url('fonts/Cambria.woff') format('woff'),
url('fonts/Cambria.ttf') format('truetype'),
url('fonts/Cambria.svg') format('svg');
font-weight: normal;
font-style: normal;
}
from __future__ import absolute_import
from tempfile import NamedTemporaryFile
from django.conf import settings
from django.http import HttpResponse
from django.template.response import TemplateResponse
from django.utils.encoding import smart_str
from django.views.generic import TemplateView
@ionatan-israel
ionatan-israel / .zshrc
Last active August 29, 2015 14:05
Algunos alias útiles.
export PIP_DOWNLOAD_CACHE=$HOME/.pip_download_cache
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
alias open='thunar'
alias gb='git branch'
alias gc='git commit -m'
alias gf='git diff'

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

@ionatan-israel
ionatan-israel / write_encoding.py
Last active March 6, 2021 19:16
Cambiar codificación de caracteres de un archivo con python.
# -*- coding: utf-8 -*-
file = 'file.csv'
outfile = 'out.csv'
f = open(file, 'rb')
# Windows Comma Separated (.csv) ~ ISO-8859-2 | CP1252
content = unicode(f.read(), 'CP1252')
f.close()
# 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)
@ionatan-israel
ionatan-israel / gulpfile.js
Last active August 29, 2015 14:10
Usando gulp para: preprocesar html con jade, css con stylus. Además es util para livereload
var gulp = require('gulp'),
connect = require('gulp-connect'),
jade = require('gulp-jade'),
stylus = require('gulp-stylus'),
watch = require('gulp-watch');
var path = {
css: './dist/css/',
html: './dist/',
jade: ['./dist/jade/**/*.jade'],