Skip to content

Instantly share code, notes, and snippets.


Marcelo Leiva marceloleiva

View GitHub Profile
View commit-message-syntax.txt
SCM Post-Commit Message Syntax
To associate an SCM commit with a specific Tracker story, you must include a special syntax in the commit message to indicate one or more story IDs and (optionally) a state change for the story. Your commit message should have square brackets containing a hash mark followed by the story ID. If a story was not already started (it was in the "not started" state), a commit message will automatically start it. For example, if Scotty uses the following message when committing SCM revision 54321:
[#12345677 #12345678] Diverting power from warp drive to torpedoes.
marceloleiva / factories.yml
Last active Aug 29, 2015
Configuración de Symfony 1.0 para memcached
View factories.yml
class: sfCacheSessionStorage
session_name: sfproject #[required] name of session to use
session_cookie_path: / #[required] cookie path
session_cookie_domain: #[required] cookie domain
session_cookie_lifetime: +30 days #[required] liftime of cookie
View base.html
{% load staticfiles %}
<!DOCTYPE html>
<style type="text/css">
@page {
size: a4 portrait;
margin: 1cm;
View gunicorn_start.bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
marceloleiva / Vagrantfile
Created Jun 16, 2015
Conectar Django remotamente con MySQL en Vagrant
View Vagrantfile = "chef/ubuntu-14.04" "private_network", ip: "" :forwarded_port, guest: 3306, host: 9306
View Gruntfile.js
* Grunt
* $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev
module.exports = function(grunt) {
// Sass

Guide to install PyQt5 on Mac OS X with python 3.4 virtualenv


A simple guide to install PyQt5 on Mac OS X and use python 3.4 on a virtualenv.


  • python 3.4
  • Qt5
  • SIP
import re
cadena = "open('../Attachment/ViewAttachment.aspx?enc=%2fnzOJlvQE1Q5cGviPAFZ%2fAwP4DzDJBri%2bWK1%2fBimEpHECqkBoS5%2fQKtpmZ8x8fmj8rudm2jNRnGPgHzbTdOH3wtcK8STvRkmfjkfy8XUF6xwUBoBbErAErrL7%2bg3Tt6XjP5AEjY6C3dNZP8NBOhAKlniJExwmfRWBRMuA%2bUju6Isl8ncH617vzflGWloZhbNcolIDIK7lzetNeOBVdzdNVV6Yrz7sbhBYzTkIIjuxmZVoHFTrr7h0sqPmH%2bU5y5iaWXxqB%2f1h7awOfzQPqpOt6sg3ZpXKUvaD6XO8fikAjmcWJ3FqzcS3KRFNfiD4S7V','MercadoPublico', 'width=850, height=700, status=yes, scrollbars=yes, left=0, top=0, resizable=yes');window.event.returnValue=false;"
patron = r".+\?enc=([a-zA-Z0-9%]+)"
patron2 = r".*enc=([^']*).*"
resultado = re.match(patron, cadena)
## problemas con encoding Ã
import codecs
import csv
def gen():
f ="Ventas.csv", "rb", "utf16")
yield next(f).encode("utf-8")
for i in f:
marceloleiva /
Last active Aug 29, 2015 — forked from josharian/
Simple Django middleware that delays the processing of each request
This module provides very simple Django middleware that sleeps on every request.
This is useful when you want to simulate slow response times (as might be
encountered, say, on a cell network).
To use, add this middleware, and add a value for SLEEP_TIME to your settings.
Possible future feature: Look for an X-Django-Sleep header on each request,
to let the client specify per-request sleep time.