Skip to content

Instantly share code, notes, and snippets.

@xlarsx
xlarsx / evernoteHandler
Created September 4, 2015 07:10
Evernote Handler
on run {input, parameters}
repeat with this_item in the input
set the item_info to info for this_item
tell application id "com.evernote.evernote"
activate
create note from file this_item
end tell
end repeat
return input
end run
@xlarsx
xlarsx / loadLastBranches.py
Created May 6, 2015 22:32
Git: Load All Branches
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import git
from gitdb import GitDB
basePath = "."
reposPath = ["billsios7"]

Keybase proof

I hereby claim:

  • I am xlarsx on github.
  • I am xlarsx (https://keybase.io/xlarsx) on keybase.
  • I have a public key whose fingerprint is C48E 8EA3 F0A2 3029 0805 6762 9F13 C6B6 F63B A81C

To claim this, I am signing this object:

@xlarsx
xlarsx / findt.sh
Last active December 17, 2015 04:59
Bash: Find inside of files
#!/bin/bash
DIRECTORY=$(cd `dirname .` && pwd)
ARGUMENTS="'$@'"
echo find: $ARGUMENTS on $DIRECTORY
find . -maxdepth 5 -type f -exec grep "$@" {} +
@xlarsx
xlarsx / gist:948788
Created April 29, 2011 18:43
QT Transformation Widget
## Ref: http://www.qtcentre.org/threads/27130-Rotate-QGraphicsProxyWidget-in-QGraphicsView
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGraphicsView gv;
QGraphicsScene scene(-200,-200,400,400);
gv.setScene(&scene);
@xlarsx
xlarsx / EventosDecorados.py
Created March 9, 2011 20:51
Ejemplo de gestión de eventos con decoradores en Python
class MiBoton(object):
def __init__(self):
self.delegadoClic = None
self.on_clic = self.obtenDecorador()
def obtenDecorador(self):
def decorador(f):
self.delegadoClic = f
def funcionInterna(*arg1, **arg2):
f(*arg1, **arg2)
@xlarsx
xlarsx / Apuntes Clojure.txt
Created March 8, 2011 17:01
Notas de Clojure
=> def - Definición de un macro
Ejemplo:
(def nomSimbolo "Texto")
=> ns - Definición de una namespace
Ejemplo:
(ns namespace1)
Variantes:
:use - Importa al namespace otro namespace
Ejemplo:
@xlarsx
xlarsx / BusquedaArchivos.py
Created March 7, 2011 19:53
Búsqueda de archivos por patrones en un directorio recursivamente
import os, re
def procesamientoCodificacion(archivo):
try:
return unicode(archivo)
except:
return archivo
def busquedaArchivos(nDirectorio, delegado, patron = ".*"):
if os.path.isdir(nDirectorio):
@xlarsx
xlarsx / ValidaPATH.py
Created March 7, 2011 16:25
Utilidad que valida la variable de entorno PATH y aquellas variables de entorno con las que está relacionado
import os, re
def evalua(matchobj):
textoAnterior = matchobj.group(0)
llave = textoAnterior[1 : len(textoAnterior) - 1]
if llave in os.environ:
return os.environ[llave]
return textoAnterior
def validaRutas(texto):
class Canvas(object):
def __init__(self, lock):
self.lock = lock
def __enter__(self):
ContenedorCanvas.estableceObjeto(self)
return self
def __exit__(self, type, value, tb):
ContenedorCanvas.terminaUsarObjeto(self)