Skip to content

Instantly share code, notes, and snippets.

user> (defrecord MyRec [x])
user.MyRec
user> (def m (->MyRec 5))
#'user/m
user> (instance? MyRec m)
true
user> (eval (defrecord MyRec [x]))
user.MyRec
user> (def m2 (->MyRec 5))
#'user/m2
@mrrodriguez
mrrodriguez / gist:5498087
Last active December 16, 2015 21:10
Personal Emacs configuration.
(setq mac-option-modifier 'control)
(setq mac-command-modifier 'meta)
;; fix the PATH variable
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell (shell-command-to-string "$SHELL -i -c 'echo $PATH'")))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(when window-system (set-exec-path-from-shell-PATH))
@mrrodriguez
mrrodriguez / gist:e2138f220a9aa7eacc20
Created May 6, 2014 18:56
Comparing clj record ctor options performance
(defrecord MyTest [a b c d e f g h i j])
;= user.MyTest
(time (dotimes [_ 10000000]
(new MyTest 1 2 3 4 5 6 7 8 9 10)))
;= "Elapsed time: 11.227 msecs"
;= nil
(time (dotimes [_ 10000000]
(->MyTest 1 2 3 4 5 6 7 8 9 10)))
package example.drools;
public class Utils {
public static Boolean useless(final Object... os) {
System.out.println("here");
return true;
}
public static Boolean useless1(final Object... os) {
System.out.println("here");
return true;
package drools
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.HashSet;
import java.util.ArrayList;
import example.drools.*;