Skip to content

Instantly share code, notes, and snippets.

(defmacro dbg[x] `(let [x# ~x] (println '~x "=" x#) x#))
java.lang.Exception: Kablammo
at cheese_factory.mozarella$load_cheese_by_id.invoke (NO_SOURCE_FILE:1)
clojure.core$map$fn__4207.invoke (core.clj:2485)
clojure.lang.LazySeq.sval (LazySeq.java:42)
clojure.lang.LazySeq.seq (LazySeq.java:60)
clojure.lang.RT.seq (RT.java:484)
clojure.core$seq.invoke (core.clj:133)
clojure.core$map$fn__4207.invoke (core.clj:2479)
clojure.lang.LazySeq.sval (LazySeq.java:42)
clojure.lang.LazySeq.seq (LazySeq.java:60)
(defn make-cheese
[name
region
country
aoc?
pdo?
doc?
milk-origin
milk-origin-subspecies
pastuerized?
puts ["ass", "write", "mouth", "check", "cash"].permutation(5).to_a.shuffle.map {|words| "Your #{words[0]} is #{words[1]}ing #{words[2]}s that your #{words[3]} can't #{words[4]}!".gsub(/writeing/, "writing").gsub(/asss/, "asses")}
@jennifersmith
jennifersmith / Bootstrapping scripts.md
Last active December 22, 2015 10:58
Bootstrapping scripts

I am writing some bootstrapping scripts to manage downloading a bunch of data from s3, creating a postgres db, dumping the data into it. Dependencies are on s3cmd and postgres being available from your local package manager.

The idea behind these scripts is largely to guide someone new to the project in setting up their machine with the right data in the right location. Where they need to get access keys and other credentials (from me by magic secure pixie delivery, not in source control), I want them to know what they need and where to plug these things into the script where possible. It's about getting a smart person up and running quickly, avoiding many manual steps etc. I don't need to go full, all-out puppet - happy to make the script stop with a message "Now go and install foreman".

The fact I am concerned with databases etc. is more to do with the nature of our current project. It's a technique I have used/seen used in the past to set up AWS permissions, local dev servers and the like. I originally s

(run 2 [n] (conda ((== 1 2) (== 1 1)) ((== 30 n))))
;; returns 30 as first clause fails
(run 4 [n] (conda ((== 1 1) (== 2 1)) ((== 30 n))))
;; fails as first clause succeeded but rem didnt + is commited to that branch
(run 4 [n] (condu ((== 1 2) (== 1 1)) ((== 1 n))))
(ns horse-ebooks.core
(:require [clojure.java.io :refer :all]
[clojure.string :as s]))
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
(defn line-is-not-valid [a-line]
anaphora-0.1.0
clojure-mode-2.1.0
color-theme-sanityinc-solarized-2.25
color-theme-sanityinc-tomorrow-1.10
color-theme-solarized-20120301
dash-1.3.2
elpakit-1.0.6
magit-1.2.0
markdown-mode-1.9
midje-mode-0.1.2
Caused by: ! org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter@650c78e3' was successfully initialized, but failed to start. Please see attached cause exception.
! at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:497) ~[insights-graph-api.jar:na]
! at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:104) ~[insights-graph-api.jar:na]
! at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:260) ~[insights-graph-api.jar:na]
!... 21 common frames omitted
Caused by: ! org.neo4j.kernel.StoreLockException: Unable to lock store as store dir does not exist and instance is in read-only mode
! at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:67) ~[insights-graph-api.jar:na]
! at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:40) ~[insights-graph-api.jar:na]
! at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:
@jennifersmith
jennifersmith / gist:5490987
Last active December 16, 2015 20:18
Debugging tools for the dojo