Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am shilder on github.
  • I am dshilov (https://keybase.io/dshilov) on keybase.
  • I have a public key ASBxIx6H68ImTZJyXsrVUE1JXF7Cs6DpTS1eiwXOGpmEywo

To claim this, I am signing this object:

@shilder
shilder / repl.pitfalls.clj
Created August 15, 2018 15:49
clojure fn caching and deftype issues
(ns repl.pitfalls
(:require [clojure.core.async :as async])
(:import (java.util.concurrent DelayQueue Delayed TimeUnit)))
; some interesting repl behaviour
; this are not bugs, but just some counterintuitive behaviour
; all of the described issues are caused by some state (thread/queue/defonce)
; fn-caching
(defn foo [a]
@shilder
shilder / generate.sh
Created August 13, 2018 16:53
clojure-soap-simple
# generate java sources for WSDL
# http://fias.nalog.ru/WebServices/Public/DownloadService.asmx?WSDL
wsimport -B-npa -Xnocompile -s src/java -encoding utf-8 -p ru.nalog.fias resources/DownloadService.xml
@shilder
shilder / aleph-ws-client.clj
Created February 13, 2018 15:25
Aleph websocket simplest client
(require '[aleph.http :as http])
(require '[manifold.stream :as s])
(require '[manifold.deferred :as d])
;; connection will hold duplex stream
;; deref will block while client is connecting
(defonce connection @(http/websocket-client "wss://url/"))
;; calls provided callback with every message on websocket
(s/consume