Skip to content

Instantly share code, notes, and snippets.

View zodman's full-sized avatar
🤗
Code wins arguments!

Andres Vargas zodman

🤗
Code wins arguments!
View GitHub Profile
def sixteenize(string, filler=" "):
fill=16-len(string)%16
return string + filler*fill
"""
code: zodman
Fabric es una herramienta que uso desde mis proyectos para evitar realizar
tareas repetidas ( si lo hago mas de 2 veces hago un script).
Tiene una funcion especial que llama do_rebuild() esta funcion se encarga
de traers el ultimo log de svn y revisar palabras claves en el commit.
Dependiendo a esta palabra clave realiza una accion.
@zodman
zodman / uwsgi-projectname
Created August 1, 2012 17:17
uwsgi init script
#!/bin/bash
# uwsgi - Use uwsgi to run python and wsgi web apps.
#
# chkconfig: - 85 15
# description: Use uwsgi to run python and wsgi web apps.
# processname: uwsgi
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/uwsgi-2.7
@zodman
zodman / uwsgi-projectname
Created August 1, 2012 17:22
uwsgi init new script
#!/bin/bash
# uwsgi - Use uwsgi to run python and wsgi web apps.
#
# chkconfig: - 85 15
# description: Use uwsgi to run python and wsgi web apps.
# processname: uwsgi
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/uwsgi
@zodman
zodman / invalid_chars.js
Created August 20, 2012 17:54
Validando caracteres extraños en un input
(function($){
$.fn.invalid_chars = function(){
return this.each(function(){
var obj = $(this);
obj.unbind("keyup");
obj.bind("keyup",function (e){
@zodman
zodman / push.js
Created August 20, 2012 23:10
trigger google push event
function trackLink(category, action, opt_label) {
var id = GGANA_GLOBAL_ID;
console.log("track:::", id);
console.log("track:::", category, action, opt_label);
var ret = _gat._getTracker(id)._trackEvent(category, action, opt_label);
console.log("track:::", ret);
}

Tryton ERP. Software Libre para las empresas.

@zodman
zodman / presentation.md
Created September 14, 2012 04:49
tryton presentation

Software libre para empresas

tryton img

¿Qué es tryton?

@zodman
zodman / gist:3723650
Created September 14, 2012 18:13
prestantacion
![tryton img](http://www.tryton.org/img/header.png)
Software libre para empresas
----------------------------
_por @zodman_
!
¿Qué es tryton?
@zodman
zodman / get_near_point.py
Created September 21, 2012 17:16
Calc the near lat,lng in radius
import random
def get_near_point( lat,lng, radius):
""" http://gis.stackexchange.com/questions/25877/how-to-generate-random-locations-nearby-my-location"""
import math
u = random.random()
v = random.random()
r_d = radius/111300.0
t = 2* math.pi*v
w = r_d * math.sqrt(u)
x = w* math.cos(t)