Skip to content

Instantly share code, notes, and snippets.

@EmmanuelPL
EmmanuelPL / QueryDSL.groovy
Created January 5, 2018 19:11
A helper class useful for mock Grails services and test the parameters of a DSL
class QueryDsl {
Map data = [:]
def methodMissing(String name, agrs) {
if (agrs.length == 1)
data[name] = agrs[0]
else
data[name] = agrs
}
}
@EmmanuelPL
EmmanuelPL / VariablesAtomicas.c
Created August 8, 2017 18:44
Ejemplos de variables atomicas de C11 con referencias a la documentacion
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
/**
* stdatomic.h
*
* Agregado en C11 standard (ISO/IEC 9899:2011)
* Implemendo en GCC 4.9
@EmmanuelPL
EmmanuelPL / TraitsExample.groovy
Last active August 4, 2017 18:55
Code Kata. Traits in groovy example and a little of meta-programming in runtime
import groovy.transform.AutoClone
/* Traits */
trait Vencible {
Date vencimiento
}
trait Antelable implements Vencible {
@EmmanuelPL
EmmanuelPL / buttons.js
Last active March 3, 2017 17:48
TestTransitionCSS
/** buttons.js */
var pos = 0;
var posI = 0;
function previous(pos) {
if (pos > 0)
{
return pos - 1;
}
@EmmanuelPL
EmmanuelPL / vector_set_example.cpp
Last active July 18, 2016 18:32
Example of the use of std vector, set, stringstream and for_each
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <string>
#include <sstream>