Skip to content

Instantly share code, notes, and snippets.

View mvaled's full-sized avatar
🏠
Working

Manuel Vázquez Acosta mvaled

🏠
Working
  • Merchise Autrement
  • Cuba
  • X @mvaled
View GitHub Profile
@mvaled
mvaled / custom-realgud.el
Created February 7, 2014 21:01
How to attach a command buffer to current source buffer [draft]
(when (and (require 'dash) (require 'realgud) (require 'grizzl))
(defun xars-grizzl-select-cmdbuf()
"Lets the user select a realgud command buffer, unless there's a single
command buffer, in which case returns the buffer directly."
(interactive)
(let ((cmdbuffers (-select #'realgud-cmdbuf? (buffer-list))))
(if (> (length cmdbuffers) 1)
(let* ((cmdbuffers-names (-map #'buffer-name cmdbuffers))
(cmdbuffers-index (grizzl-make-index cmdbuffers-names)))
(let ((selection (grizzl-completing-read
@mvaled
mvaled / main.cf
Last active August 29, 2015 14:06
Postfix configuration for delivering to OpenERP that may lead to double processing of emails.
# many options here
mydestination = localhost.localdomain, localhost
recipient_delimiter = +
transport_maps = hash:/etc/postfix/transport
virtual_mailbox_domains = example.com
virtual_mailbox_maps = pgsql:/etc/postfix/pg-aliases.cf
@mvaled
mvaled / gist:eb5e043e0d625c824751
Last active August 29, 2015 14:06
User Defined Java - Step in pentaho to reproduce previous row values if current are null.
Object[] previousRow;
RowMetaInterface outputMeta;
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
{
// First, get a row from the default input hop
Object[] r = getRow();
// If the row object is null, we are done processing.
if (r == null) {
@mvaled
mvaled / fuzzy.ktr
Created October 3, 2014 18:14
Demo of a possible bug in fuzzy match
<?xml version="1.0" encoding="UTF-8"?>
<transformation>
<info>
<name>fuzzy</name>
<description/>
<extended_description/>
<trans_version/>
<trans_type>Normal</trans_type>
<directory>&#x2f;</directory>
<parameters>
@mvaled
mvaled / runtests.log
Last active August 29, 2015 14:21
Odoo logs
Testing addons: xopgi_mail_verp,
INFO ? openerp: OpenERP version 8.0
INFO ? openerp: addons paths: ['/home/manu/src/merchise/pgi/xhg/var/run/addons/8.0', u'/home/manu/src/merchise/pgi/xhg/usr/lib/addons/8', u'/home/manu/src/merchise/pgi/odoo/addons', '/home/manu/src/merchise/pgi/openerp/openerp/addons', u'/home/manu/src/merchise/pgi/xhg.ca.bank/xhg/ca', u'/home/manu/src/merchise/pgi/xhg.ca.hr/xhg/ca', u'/home/manu/src/merchise/pgi/xopgi.hotfixes/xopgi', u'/home/manu/src/merchise/pgi/xopgi.backports/xopgi', u'/home/manu/src/merchise/pgi/xopgi.account/xopgi', u'/home/manu/src/merchise/pgi/xopgi.base/xopgi', u'/home/manu/src/merchise/pgi/xopgi.calendar/xopgi', u'/home/manu/src/merchise/pgi/xopgi.hr/xopgi', u'/home/manu/src/merchise/pgi/xopgi.hr_contract/xopgi', u'/home/manu/src/merchise/pgi/xopgi.hr_holidays/xopgi', u'/home/manu/src/merchise/pgi/xopgi.resource/xopgi', u'/home/manu/src/merchise/pgi/xopgi.mail/xopgi', u'/home/manu/src/merchise/pgi/xopgi.mail_threads/xopgi', u'/home/manu/src/merchise/pgi/xopgi.evan
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# put in /etc/munin/plugins and restart munin-node
# by Dan Manges,
# http://www.dcmanges.com/blog/rails-application-visualization-with-munin
# NOTE: you might need to add munin to allow passwordless sudo for
# passenger-memory-stats
@mvaled
mvaled / gist:720753
Created November 29, 2010 22:22
Generates Wordpress.com's HTML from reStructuredText
#! /usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Generate an HTML Snippet for WordPress Blogs from reStructuredText.
#
# This is a modification of the standard HTML writer that leaves out
# the header, the body tag, and several CSS classes that have no use
# in wordpress. What is left is an incomplete HTML document suitable
# for pasting into the WordPress online editor.
#
@mvaled
mvaled / ClaseX.php
Created December 16, 2010 16:25
A basic PHP IoC implementation.
<?php
class ClaseX {
private static $info;
public static function RegistrarInformacion($info) {
echo "Me estan poniendo informacion $info \n";
self::$info = $info;
}
}
@mvaled
mvaled / module.rb
Created October 4, 2011 03:09
Ejemplo de módulos en Ruby. Ver post: http://manuelonsoftware.wordpress.com/?p=225
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
# Mostly stealed from ActiveSupport
class Module
# Encapsulates the common pattern of:
#
# alias_method :foo_without_feature, :foo
# alias_method :foo, :foo_with_feature
#
@mvaled
mvaled / renames_files.py
Created September 11, 2012 19:32
Normalizes files titles in a Plone instance
import transaction, pdb
from zope.interface import implementedBy
from zope.component import getUtility, queryUtility, queryAdapter
from Zope2 import debug
from Acquisition import aq_inner, aq_parent, aq_chain
from zope.app.component.hooks import setSite, getSiteManager
from Testing.makerequest import makerequest
from AccessControl.SecurityManagement import newSecurityManager, getSecurityManager