Skip to content

Instantly share code, notes, and snippets.

Tom Hickey thickey

Block or report user

Report or block thickey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thickey
thickey / cider+deps.md
Last active Oct 26, 2018
Cider jack-in with tools.deps
View cider+deps.md

Instructions

Note: you must have Cider version 0.18.*

For pure tools.deps (non-lein)

In deps.edn

{:paths ["src" "resources"]
 :deps {org.clojure/clojure {:mvn/version "1.9.0"}}
@thickey
thickey / deps+nrepl.md
Last active Oct 26, 2018 — forked from solussd/deps+nrepl.md
nrepl + deps.edn quickstart
View deps+nrepl.md

Instructions

  1. Add nrepl server dep to deps.edn :dev alias extra deps
org.clojure/tools.nrepl {:mvn/version "0.2.12"}
  1. create dev/user.clj containing the following:
(ns user
  (:require [clojure.tools.nrepl.server :as nrepl]))
@thickey
thickey / README.md
Last active Oct 14, 2017
Handling multiple results from Clojure with SQL the includes temp tables
View README.md

Handling multiple results from SQL that includes temp tables.

NB! this is using clojure.java.jdbc v0.6.1, as we have performance issues w/ 0.7.x

Although this gist was very helpful when all statements return results, this is what is ultimately needed to properly traverse the intermediate reults that return nothing (e.g. temp tables).

View keybase.md

Keybase proof

I hereby claim:

  • I am thickey on github.
  • I am thickey (https://keybase.io/thickey) on keybase.
  • I have a public key whose fingerprint is 0ED7 4731 F2C7 F5EE 5635 8BB7 818A EC24 E433 4A5D

To claim this, I am signing this object:

View core.cljs
(ns nested-routing.core
(:require-macros [om.core :as om]
[secretary.core :refer [defroute]])
(:require [om.dom :as dom]
[om.core :as om]
[secretary.core :as secretary]
[goog.events :as events]
[goog.history.EventType :as EventType])
(:import goog.History))
View keybase.md

Keybase proof

I hereby claim:

  • I am thickey on github.
  • I am thickey (https://keybase.io/thickey) on keybase.
  • I have a public key whose fingerprint is 0F57 43A7 EEA0 7E10 A21C 2246 3036 3ED5 7F1F 6258

To claim this, I am signing this object:

View init.el
;; Clojure
(require 'clojure-mode)
(setq auto-mode-alist (cons '("\\.cljs$" . clojure-mode) auto-mode-alist))
(setq inferior-lisp-program "lein repl")
;; clj-refactor
(require 'clj-refactor)
(add-hook 'clojure-mode-hook (lambda ()
(clj-refactor-mode 1)
(cljr-add-keybindings-with-prefix "C-c C-o")))
View Retry-Command.ps1
function Retry-Command
{
param (
[Parameter(Mandatory=$true)][string]$command,
[Parameter(Mandatory=$true)][hashtable]$args,
[Parameter(Mandatory=$false)][int]$retries = 5,
[Parameter(Mandatory=$false)][int]$secondsDelay = 2
)
# Setting ErrorAction to Stop is important. This ensures any errors that occur in the command are
View human_log.py
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr']
def human_log(res):
if type(res) == type(dict()):
for field in FIELDS:
if field in res.keys():
encoded_field = res[field].encode('utf-8')
print '\n{0}:\n{1}'.format(field, encoded_field)
@thickey
thickey / nrepl-eval-form-to-repl.el
Last active Dec 28, 2015
A little bit of elisp for outputting the form in the repl buffer in front of output. (a la Tim Baldridge's Clojure/conj 2013 core.async presentation).
View nrepl-eval-form-to-repl.el
;; Works with nrepl-0.1.6.el
(defun my-form-printing-handler (buffer form)
(lexical-let ((form form))
(nrepl-make-response-handler buffer
(lambda (buffer value)
(nrepl-emit-result buffer (format "%s" form) t)
(nrepl-emit-result buffer (format "%s" value) t))
(lambda (buffer out)
(nrepl-emit-output buffer out t))
You can’t perform that action at this time.