Skip to content

Instantly share code, notes, and snippets.

View enaeher's full-sized avatar

Eli Naeher enaeher

View GitHub Profile
@arohner
arohner / google-api.clj
Created November 5, 2016 21:53
Clojure example of accessing google APIs directly
(ns example.api.google
(:require [cemerick.url :as url]
[cheshire.core :as json]
[clj-jwt.core :as jwt]
[clj-jwt.key :as key]
[clj-time.core :as time]
[clj-http.client :as http]
[clojure.string :as str])
(:import java.io.StringReader))
@timothypratley
timothypratley / forshame.md
Last active June 11, 2021 05:06
Error reporting in Clojure are the worst, no error reporting in ClojureScript is the worst.

For Shame!

Clojure error reporting is a problem. This gist contains examples of missed opportunities for a clear error message. Let's discuss how common scenarios can be improved, and get some "patch welcome" tickets out there with clearly defined expectations.

The problem

@gerritjvv
gerritjvv / gist:5866665
Last active July 19, 2024 13:29
Calling an external process from Clojure
(comment
This is the easiest and most concise way of calling an external process in Java. The inheritIO methods causes the command to output stdout and errout to the same place as your current process (which most of the times is the console), no need to create mechanisms for reading asynchronously from input streams to get at the information.
http://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html
)
(def ret (.waitFor (-> (ProcessBuilder. ["gzip" "-t" "g.txt.gz"]) .inheritIO .start)))