Skip to content

Instantly share code, notes, and snippets.

Allen Rohner arohner

Block or report user

Report or block arohner

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
View gist:bd9995a2fcae22f51c458946485d6651
### Keybase proof
I hereby claim:
* I am arohner on github.
* I am arohner (https://keybase.io/arohner) on keybase.
* I have a public key ASDBb6_DdjJJsU7SDLNwjCHqnyvRDgmULf_nDTu9-RWpLQo
To claim this, I am signing this object:
@arohner
arohner / google-api.clj
Created Nov 5, 2016
Clojure example of accessing google APIs directly
View google-api.clj
(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))
View gist:72c9c212d12a1b226fd6
{:user {:mirrors {#"clojars" {:name "tcrawley"
:url "https://clojars-mirror.tcrawley.org/repo/"}}
}}
@arohner
arohner / gist:77deaf47503c73654493
Last active Aug 29, 2015
core.typed & pedestal tools.analyzer.jvm conflict
View gist:77deaf47503c73654493
(defn- go-async
"When presented with a channel as the return value of an enter function,
wait for the channel to return a new-context (via a go block). When a new
context is received, restart execution of the interceptor chain with that
context.
This function is non-blocking, returning nil immediately (a signal to halt
further execution on this thread)."
[old-context context-channel]
(prepare-for-async old-context)
@arohner
arohner / gist:d7a6bb057824c224b5b3
Created May 25, 2015
rudimentary core.typed datomic annotations
View gist:d7a6bb057824c224b5b3
;;; Extremely incomplete type annotations for Datomic.
(ns foo.util.type.datomic
(:require [clojure.core.typed :as t]
[datomic.api :as d])
(:import (datomic Connection
Database)
(datomic.db DbId)
(java.util Date UUID)))
View gist:70596d1ca051a94de83d
(ns foo.bar
(:require [clojure.tools.logging.impl]
[clojure.core.typed :as t :refer (ann)])
(:import (clojure.tools.logging.impl LoggerFactory Logger)
(clojure.lang Namespace
Symbol)))
(ann ^:no-check clojure.tools.logging/*logger-factory* LoggerFactory)
(ann ^:no-check clojure.tools.logging.impl/get-logger (t/Fn [LoggerFactory (t/U clojure.lang.Symbol Namespace) -> clojure.tools.logging.impl.Logger]))
(ann ^:no-check clojure.tools.logging.impl/enabled? (t/Fn [Logger t/Keyword -> Boolean]))
View gist:03b60a9de3282e970deb
java.util.zip.ZipException: duplicate entry: WEB-INF/lib/tagsoup-1.2.1.jar
at java.util.zip.ZipOutputStream.putNextEntry (ZipOutputStream.java:233)
java.util.jar.JarOutputStream.putNextEntry (JarOutputStream.java:109)
sun.reflect.GeneratedMethodAccessor78.invoke (:-1)
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke (Method.java:483)
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:93)
clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:28)
leiningen.ring.war$write_entry.invoke (war.clj:185)
leiningen.ring.war$file_entry.invoke (war.clj:201)
View gist:c5e0fa45229c408301e2
(defn wrap-reloading [{:keys [reloading?] :as args}]
(if reloading?
(fn [req]
((#'handler args) req))
(handler args)))
@arohner
arohner / gist:e8b839ea82ce78aed7a0
Created Feb 20, 2015
cljs foreign libs weirdness
View gist:e8b839ea82ce78aed7a0
Uncaught Error: Undefined nameToPath for com.bootstrapbase.js:739
visitNodebase.js:753
goog.writeScripts_base.js:459
goog.requiredashboard:4
(anonymous function)
:cljsbuild {:builds {:dev {:source-paths ["src/cljs"]
:compiler {:output-to "dev-resources/public/js/app.js"
:output-dir "dev-resources/public/js/"
View gist:566f7811ce30dd295b51
public class LaunchAtStartup : NSObject
{
public class func enumerateLaunchItems()
{
let loginItemsRef = LSSharedFileListCreate(nil, kLSSharedFileListSessionLoginItems.takeUnretainedValue(), nil).takeUnretainedValue()
var itemUrl:NSURL?
You can’t perform that action at this time.