Skip to content

Instantly share code, notes, and snippets.

View RickMoynihan's full-sized avatar

Rick Moynihan RickMoynihan

  • Swirrl
  • Manchester
View GitHub Profile
(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))
;; 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]]))
@RickMoynihan
RickMoynihan / evaluate.clj
Last active August 29, 2015 14:22
Simple timbre logging macro to log the contents of the current lexical environment
(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 function updates the current branch with the latest changes from the
# origin repository. The master branch is checked out, a git pull is performed,
# the original branch is checked out again, and then the changes from master
# are rebased back into the branch.
#
# Essentially, the following steps are performed. The command is smart enough
# to do the right thing when the current branch _is_ the master branch.
#
# git checkout master
# git pull --rebase
@RickMoynihan
RickMoynihan / Migration-Syntax.clj
Created February 26, 2010 15:09
Rails like Database Migrations in Clojure... Using clojure.contrib.sql
(def migrations (sorted-map
;; Migrations are numbered by integer values to explicitly document them
1 {
:doc "Foo Table"
:up (fn []
(create-table
:Foo
[:id :int "PRIMARY KEY" "NOT NULL GENERATED ALWAYS AS IDENTITY"]
; store a JSON blob in here for the screening record
(defun slime-reset-clojure-namespace ()
"Reloads the current Clojure namespace by first removing it and
then re-evaluating the slime buffer. Use this to remove old
symbol definitions and reset the namespace to contain only what
is defined in your current Emacs buffer."
(interactive)
(slime-interactive-eval (concat "(remove-ns '" (slime-current-package) ")"))
(slime-eval-buffer))
Exception in thread "main" java.lang.IllegalArgumentException: No matching field found: getCommandLine for class org.apache.tools.ant.taskdefs.Java (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:4658)
at clojure.core$eval__5236.invoke(core.clj:2017)
at clojure.main$eval_opt__7411.invoke(main.clj:227)
at clojure.main$initialize__7418.invoke(main.clj:246)
at clojure.main$null_opt__7446.invoke(main.clj:271)
at clojure.main$main__7466.doInvoke(main.clj:346)
at clojure.lang.RestFn.invoke(RestFn.java:426)
at clojure.lang.Var.invoke(Var.java:363)
at clojure.lang.AFn.applyToHelper(AFn.java:175)
(add-hook 'slime-connected-hook
(lambda ()
(interactive)
(slime-redirect-inferior-output t)))
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
(add-hook 'clojure-mode-hook '(lambda ()
(paredit-mode 1)))