Skip to content

Instantly share code, notes, and snippets.

Howard M. Lewis Ship hlship

Block or report user

Report or block hlship

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
hlship / norad.clj
Last active Jun 7, 2019
Sample Joker script
View norad.clj
#!/usr/bin/env joker
(ns script
(:require [ :as cli]
[joker.os :as os]
[joker.strconv :refer [atoi]]))
(def opts
[["-d" "--defcon VALUE" "Set DEFCON level"
:parse-fn atoi
hlship / response.json
Created Apr 12, 2019
Example useless JSON response
View response.json
"status": "FAIL",
"payload": {
"errors": [
"field": "header",
"category": "APPLICATION",
"description": "Error description not available",
"severity": "ERROR",
"code": "org.apache.commons.json.JSONException",
View extract-docs.clj
(ns extract-docs
[medley.core :refer [filter-vals]]
[ :as io]
[clojure.string :as str]
[clojure.edn :as edn])
( PrintWriter Writer File)))
(defn full-name [k]
View deep-nesting.clj
(map #(assoc % :full-name (str (:first-name %) " " (:last-name %))) (sort-by :last-name) (filter #(= "97204" (:zip person)) (get-contacts db))
View task.clj
(deftask base-image
"Builds the base image for other images."
(comp (init :dir (io/file "base") :from "anapsix/alpine-java:8")
(add :file [""])
(artifact :dependency '[[org.bouncycastle/bcprov-jdk15on "1.54"]] :target "/opt/jdk/jre/lib/ext/")
(artifact :dependency '[[com.walmartlabs/timestamper "0.1.2"]] :target "/usr/local/java-agents/")
(inst :section :postamble :inst :run :arguments ["chmod a+x"])
(build-image :image-name "base" :version default-base-version)))
View tasks.docker.clj
(deftask init
"First step when building a Docker image. Optionally specifies a directory
of resources that can be added to the image."
[d dir DIR file "Directory to add."
f from IMAGE str "Base image name."]
(assert from "--from is required")
(assert (or (nil? dir)
(is-readable-directory? dir))
"--dir must specify an existing directory")
(with-pre-wrap fs
View gist:61909bddf85f0fcb395a361d8358e778
> boot pom --project example --version 0.1 -- jar -- install
Writing pom.xml and
Writing example-0.1.jar...
Installing example-0.1.jar...
View gist:ffc8f21009f62a76e654aba3a1d749b8
> boot repl
nREPL server started on port 62614 on host - nrepl://
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.9.0-alpha10
Java HotSpot(TM) 64-Bit Server VM 1.8.0_74-b02
Exit: Control+D or (exit) or (quit)
Commands: (user/help)
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
View gist:dd5bc5889d9608e1357201e799b13d78
> boot hello
Hello, Howard
> boot hello -g Bonjour
Bonjour, Howard
View gist:c4d14b0a398cd04e1dac9dae006dd4a8
> boot hello --help
Prints a greeting.
-h, --help Print this help info.
-g, --greeting GREETING GREETING sets greeting to use.
-n, --name NAME NAME sets name to greet.
You can’t perform that action at this time.