Skip to content

Instantly share code, notes, and snippets.

View cddr's full-sized avatar

Andy Chambers cddr

View GitHub Profile
@cddr
cddr / docker-compose.yml
Created February 22, 2016 17:28
Docker Compose for Confluent Platform
zookeeper:
image: confluent/zookeeper
ports:
- "0.0.0.0:2181:2181"
kafka:
environment:
- KAFKA_ADVERTISED_HOST_NAME=192.168.99.100
image: confluent/kafka
links:
Dev Journal for getting nano-demo working (on OSX)
## Nanomsg hello world
* create lein project with [jnanomsg "0.4.3"]
* add `(require [nanomsg.core :as nn])`
* Ooops
```1. Unhandled java.lang.UnsatisfiedLinkError
Unable to load library 'nanomsg': Native library
(darwin/libnanomsg.dylib) not found in resource path
Dev Journal for getting nano-demo working (on OSX)
## Nanomsg hello world
* create lein project with [jnanomsg "0.4.3"]
* add `(require [nanomsg.core :as nn])`
* Ooops
```1. Unhandled java.lang.UnsatisfiedLinkError
Unable to load library 'nanomsg': Native library
(darwin/libnanomsg.dylib) not found in resource path
# Shell prompt based on the Solarized Dark theme.
# Screenshot: http://i.imgur.com/EkEtphC.png
# Heavily inspired by @necolas’s prompt: https://github.com/necolas/dotfiles
# iTerm → Profiles → Text → use 13pt Monaco with 1.1 vertical spacing.
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM='gnome-256color';
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM='xterm-256color';
fi;
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/util/Args, compiling:(cemerick/pomegranate/aether.clj:42:54)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6730)
at clojure.lang.Compiler.analyze(Compiler.java:6524)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6711)
at clojure.lang.Compiler.analyze(Compiler.java:6524)
at clojure.lang.Compiler.analyze(Compiler.java:6485)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5861)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5296)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3925)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6721)
;; This one doesn't agree with Danny's test-cases but I think it matches the spirit of
;; the problem a little better in that it doesn't include an entry for the coin if
;; the quantity of that coin would be zero.
;;
;; Also, we're global, so I used UK coins
;;
;; So e.g. (change-coins 18) = {10 1, 5 1, 2 1, 1 1}
(def coins [100 50 20 10 5 2 1])
(def ^:dynamic *foo*)
(defn call-with-foo [foo-fn]
(binding [*foo* 42]
(foo-fn)))
(call-with-foo (fn []
(map (fn [_]
*foo*)
(range 10))))
@cddr
cddr / gist:5cf86ddd7fd7a6d96234
Created July 15, 2015 21:10
Hello Samza output log
$ deploy/samza/bin/run-job.sh --config-factory=org.apache.samza.config.factories.PropertiesConfigFactory --config-path=file://$PWD/deploy/samza/config/wikipedia-feed.properties
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
java -Dlog4j.configuration=file:deploy/samza/bin/log4j-console.xml -Dsamza.log.dir=/Users/andychambers/workspace/hello-samza/deploy/samza -Djava.io.tmpdir=/Users/andychambers/workspace/hello-samza/deploy/samza/tmp -Xmx768M -XX:+PrintGCDateStamps -Xloggc:/Users/andychambers/workspace/hello-samza/deploy/samza/gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10241024 -d64 -cp /Users/andychambers/.samza/conf:/Users/andychambers/workspace/hello-samza/deploy/samza/lib/activation-1.1.jar:/Users/andychambers/workspace/hello-samza/deploy/samza/lib/akka-actor_2.10-2.1.2.jar:/Users/andychambers/workspace/hello-samza/deploy/samza/lib/aopalliance-1.0.jar:/Users/andychambers/workspac
@cddr
cddr / Emacs.md
Last active August 29, 2015 14:19

Setting up Emacs daemon on OS X

Tired of waiting for emacs to start on OS X? This step by step guide will teach you how to install the latest version of emacs and configure it to start in the background (daemon mode) and use emacsclient as your main editor.

Install Homebrew

First you'll need to install the [Homebrew package manager][brew] if yo haven't already. It is amazing.

(defentity Cart
:schema {:id Int
:name Str
:items [{:id Int
:qty Int
:price Num}]}
:uniqueness {:id :db.unique/identity})