Skip to content

Instantly share code, notes, and snippets.

View mnesarco's full-sized avatar

Frank David Martínez M mnesarco

View GitHub Profile
@mnesarco
mnesarco / SelectSample.scala
Created February 14, 2012 18:15
Mybatis Scala sample
/*
* Copyright 2011 The myBatis Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mnesarco
mnesarco / SelectWithResultMapSample.scala
Created February 14, 2012 18:20
Mybatis Scala sample 2
/*
* Copyright 2011 The myBatis Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mnesarco
mnesarco / scala-sql-interpolation.scala
Created January 12, 2013 01:15
Scala 2.10 String interpolation experiment (Sql parameters)
package tests01
object lab {
object PreparedStatement {
case class Param[A](val index : Int, val value : A)
case class BoundSql(val sql: String, val params : Seq[Param[_]])
@mnesarco
mnesarco / Client
Created January 30, 2013 03:21
JEE EJB - Mybatis example
package example.jee6mybatis;
import javax.ejb.EJB;
import javax.ejb.Stateless;
@Stateless
public class Client {
@EJB SessionWrapper mybatis;
@mnesarco
mnesarco / objects.py
Created July 23, 2020 16:54
Enhanced python properties with some metaprog.
# file: objects.py
# Copyright 2020 Frank David Martínez Muñoz (mnesarco)
# License: MIT
from typing import Union
__all__ = ('self_properties', 'properties')
def self_properties(self, scope: dict, exclude=(), save_args: bool = False):
@mnesarco
mnesarco / linuxdeploy-plugin-xdg.sh
Created December 27, 2020 03:19
linuxdeploy plugin to extract AppImage icon and set it as the AppImage Icon on XDG supported platforms.
#!/bin/bash
# ------------------------------------------------------------------------------
# Install:
# 1. Put this script alongside with linuxdeploy or in the PATH
# 2. make it executable (chmod +x linuxdeploy-plugin-xdg)
#
# Usage:
# 1. Set the env variable XDG_ICON to your png icon.
# 2. Call with linuxdeploy
@mnesarco
mnesarco / build-installer.py
Created December 27, 2020 13:25
AppImage Auto Installer Builder
#!/usr/bin/python3
#
# Copyright 2020 Frank David Martinez M. (mnesarco at github)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@mnesarco
mnesarco / example.py
Created September 24, 2021 15:40
Grid Layout Internal DSL for TKinter
from tkinter import W, Tk
from tkinter import ttk
from grid import Grid, Row, RowConfigure, ColumnConfigure, GridOptions, Dummy
window = Tk()
window.title("Grid Layout DSL")
window.geometry('400x400')
def on_click():
print("Hello from Grid layout")
@mnesarco
mnesarco / RotaryEncoder.h
Created June 30, 2022 22:48
Arduino Rotary Encoder with Automatic Debounce
/* Rotary encoder handler for arduino. v2.0
*
* Original author of version 1.1: Ben Buxton <bb@cactii.net>
* https://github.com/buxtronix/arduino/tree/master/libraries/Rotary
*
* Author of version 2.0 based on 1.1: Frank Martinez <https://twitter.com/mnesarco>
*
* Copyright 2011 Ben Buxton. Licensed under the GNU GPL Version 3.
* Contact: bb@cactii.net
*