Skip to content

Instantly share code, notes, and snippets.

@jmhdez
jmhdez / Id.cs
Created April 14, 2013 08:48
Id implementation using phantom types
public struct Id<T>
{
public readonly int Value;
public Id(int value)
{
this.value = value;
}
public static implicit operator Id<T>(int value)
@jmhdez
jmhdez / zebra-puzzle-loco.clj
Last active May 8, 2021 23:15
Solving the zebra puzzle with loco
(ns loco-playground.core
(:require [loco.core :refer :all]
[clojure.pprint :refer :all]
[loco.constraints :refer :all]))
;; http://bypacoman.blogspot.com.es/2013/08/desestructurando-el-puzzle-de-einstein.html
;; ---- Datos de referencia
(def domain
@jmhdez
jmhdez / console.js
Last active August 13, 2023 01:16
Javascript console replacement
(function(window, document) {
// Create the DOM structure to hold the console messages
var div = document.createElement("div");
div.style.cssText = "position: absolute; " +
"top: 5px; left: 5px; right: 5px; bottom: 5px; " +
"padding: 10px; " +
"overflow-y: auto; " +
"display: none; " +