Skip to content

Instantly share code, notes, and snippets.

View erikkaplun's full-sized avatar

Erik Kaplun erikkaplun

  • UXO
  • Tallinn, Estonia
View GitHub Profile
View terminusdb dlopen error
erik@iota terminusdb % ./terminusdb
ERROR: /usr/local/Cellar/swi-prolog/8.4.2/libexec/lib/swipl/library/ Initialization goal raised exception:
ERROR: dlopen(/tmp/swipl_31561_1, 1): no suitable image found. Did find:
/tmp/swipl_31561_1: malformed mach-o image: missing LC_DYSYMTAB
/tmp/swipl_31561_1: stat() failed with errno=25
ERROR: [18] throw(error(shared_object(open,'dlopen(/tmp/swipl_31561_1, 1): no suitable image found. Did find:\n\t/tmp/swipl_31561_1: malformed mach-o image: missing LC_DYSYMTAB\n\t/tmp/swipl_31561_1: stat() failed with errno=25'),context(...,_12812)))
ERROR: [16] <meta call>
ERROR: [15] with_mutex('$foreign',load_foreign_library(foreign(process),process,default(install))) <foreign>
ERROR: [12] '$run_init_goal'(shlib:load_foreign_library(...)) at /usr/local/Cellar/swi-prolog/8.4.2/libexec/lib/swipl/boot/
View sample.clj
(defn convert-stream [f-sink f-src s]
(let [sink (s/stream)
src (s/map f-src s)]
(s/connect-via sink #(s/put! s (f-sink %)) s)
(s/splice sink src)))
(defn make-duplex-stream []
(let [sink (s/stream)
src (s/stream)
duplex (s/splice sink src)]
View parser.curry
import Char (isAlpha)
import List (intercalate)
type Name = [NameChar]
type NameChar = Char
nameChar2char :: Char -> NameChar
nameChar2char c | isAlpha c = c
name2str :: Name -> String
Source code is in UTF-8 encoding. The following symbols may appear, among others:
α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ ς σ τ υ φ χ ψ ω « • ¦ » ∀ ∃ ∷ … → ← fi fl ƒ
If you can't read this, you're out of luck. This code was generated with the frege compiler version 3.24.100
from /Users/erik/code/frege/frege-clj-mix/src/frege/frege_clj_mix/ Do not edit this file!
Instead, edit the source file and recompile.
import frege.run7.Func;
import frege.run7.Lazy;
View chrome_extension.clj
[ :as io]
[ :as json]
[clojure.string :as str]
[clojure.pprint :refer (pprint)]
[ :as b]
[ :as browser]
[ :as shared]
[shadow.cljs.repl :as repl]
View foobar.clj
user=> (defn foo [n]
(with-local-vars [x 0]
(dotimes [i n]
(var-set x (inc @x)))))
user=> (time (foo 5000000))
"Elapsed time: 514.042912 msecs"
user=> (time (foo 5000000))
"Elapsed time: 438.661454 msecs"
View nrepl-exception.txt
ERROR: Unhandled REPL handler exception processing message {:op classpath, :session 17b1873d-6e54-4a77-96a2-e9a30ee136e1, :id 6}
Syntax error macroexpanding at (namespace.clj:29:8).
at clojure.lang.Compiler$InvokeExpr.eval(
at clojure.lang.Compiler$InvokeExpr.eval(
at clojure.lang.Compiler$InvokeExpr.eval(
at clojure.lang.Compiler$DefExpr.eval(
at clojure.lang.Compiler.eval(
at clojure.lang.Compiler.load(
at clojure.lang.RT.loadResourceScript(
at clojure.lang.RT.loadResourceScript(
View build.gradle
plugins {
id 'dev.clojurephant.clojure' version '0.5.0-alpha.5'
id 'application'
id 'com.github.johnrengelman.shadow' version '5.0.0'
id 'maven-publish'
group = 'myname'
version = '0.1.0-SNAPSHOT'
ZoneId zoneId = null;
try { zoneId = ZoneId.of("Europe/Tallinn"); }
catch(Exception e) {
// what the handler should do when the
// provided URL path contains an invalid zone name
// take the current time in the current timezone
LocalDateTime localDateTime =;
// "map" it to
ZonedDateTime zonedDateTime = ZonedDateTime.of(localDateTime, zoneId);
View examples.json
"coord": {"lon":-73.99, "lat":40.73},
"weather": [
{"id":501, "main":"Rain", "description":"moderate rain", "icon":"10n"}
"main": {"temp":288.02, "pressure":1022, "humidity":76, "temp_min":285.95, "temp_max":289.85},
"wind": {"speed":3.85, "deg":47.0027},
"rain": {"1h":0.66},