This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro log-env | |
([] `(log-env :info)) | |
([level] `(log-env ~level "Captured Environment is")) | |
([level message] `(log/log ~level ~message (zipmap (quote ~(keys &env)) [~@(keys &env)])))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; An example of using Grafter's Linked Data Sesame bindings to do | |
;; RDFS Inferencing. | |
(ns inferencing.core | |
(:require [grafter.rdf :refer [add statements subject predicate object prefixer]] | |
[grafter.rdf.io] | |
[grafter.rdf.formats :refer :all] | |
[grafter.rdf.ontologies.rdf :refer :all] | |
[grafter.rdf.repository :refer [memory-store repo query rdfs-inferencer]] | |
[grafter.rdf.templater :refer [graph]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun neotree-find-project-root () | |
(interactive) | |
(neotree-find (projectile-project-root))) | |
(setq projectile-switch-project-action 'neotree-projectile-action) | |
(progn | |
(global-set-key (kbd "s-s") 'neotree-toggle) | |
(global-set-key (kbd "s-r") 'neotree-find-project-root)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn get-square [rows x y] | |
(for [x (range x (+ x 3)) | |
y (range y (+ y 3))] | |
(get-in rows [x y]))) | |
(defn init [vars hints] | |
(if (seq vars) | |
(let [hint (first hints)] | |
(all | |
(if-not (zero? hint) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'rdf', '1.0.10' | |
gem 'tripod' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns immutant-bench.queue-speed-test | |
(:require [immutant.messaging :as m])) | |
;; Performance stats | |
;; | |
;; Robs mac mini (4 cores) | |
;; ----------------------- | |
;; | |
;; 10 producers, 5 consumers | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
immutant@b:~/immutant-bench$ lein immutant run | |
Starting Immutant: /home/immutant/.lein/immutant/current/jboss/bin/standalone.sh | |
java.io.IOException: Cannot run program "/home/immutant/.lein/immutant/current/jboss/bin/standalone.sh": java.io.IOException: error=13, Permission denied | |
at java.lang.ProcessBuilder.start(ProcessBuilder.java:475) | |
at java.lang.Runtime.exec(Runtime.java:610) | |
at java.lang.Runtime.exec(Runtime.java:483) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:616) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/git/immutant-bench $ lein immutant run | |
Warning: The current app may not be deployed - deploy with 'lein immutant deploy' | |
Starting Immutant: /Users/rick/.lein/immutant/current/jboss/bin/standalone.sh | |
========================================================================= | |
JBoss Bootstrap Environment | |
JBOSS_HOME: /Users/rick/.lein/immutant/current/jboss | |
JAVA: java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: Rick Moynihan | |
# (c) 2013 Stardotstar Ltd | |
# | |
# Script to aid copying .gitignore files from the github gitignore project. | |
# | |
# Usage: | |
# | |
# 1) $ git clone https://github.com/github/gitignore.git | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn &&* [symbol-seq] | |
"escape free strings" | |
(apply str (interpose " " symbol-seq))) | |
(&&* '(SELECT "users.*" FROM "users" WHERE ("users.username" = ?) ORDER BY "users.created" ASC)) | |
;; => "SELECT users.* FROM users WHERE (\"users.username\" = ?) ORDER BY users.created ASC" | |
(defmacro && [& args] | |
"Use the macro if you can't live with having to quote a list when using &&*" |