Skip to content

Instantly share code, notes, and snippets.

(ns cljdoc.pathom3
(:require [com.wsscode.pathom.core :as p]
[com.wsscode.pathom.connect :as pc]
[clojure.core.async :as async]
[clojure.set]
[cljdoc.util.repositories :as repos]
[cljdoc.util.pom :as pom]
[cljdoc.config :as config]
[cljdoc.storage.sqlite-impl :as cljdoc-sqlite]))
(ns cljdoc.pathom3
(:require [com.wsscode.pathom.core :as p]
[com.wsscode.pathom.connect :as pc]
[clojure.core.async :as async]
[clojure.set]
[cljdoc.util.repositories :as repos]
[cljdoc.util.pom :as pom]
[cljdoc.config :as config]
[cljdoc.storage.sqlite-impl :as cljdoc-sqlite]))
@martinklepsch
martinklepsch / cljdoc-august.md
Last active September 6, 2018 21:06
My cljdoc August Update for ClojuristsTogether

I switched the storage layer. SQLite is now used instead of lib-grimoire. More details in the respective architecture decision record: ADR-0013

This was a lot of work but it sets the project up for more interesting extensions besides API documentation and articles (think specs & examples).

Also I looked more into integrating specs but without changes to spec it is impossible to determine if a spec originates from the artefact that is being analysed or from one of it's dependencies. To fix this specs will need to support metadata (CLJ-2194) but the timeline for this is unclear.

In the light of this I'm considering focusing on examples first. More details to come.

Some more minor things that happened:

2018

August

2018-08-07 15:27,

  • Explored various metrics solutions to measure performance impact of new storage backend
@martinklepsch
martinklepsch / timed.clj
Created August 20, 2017 13:14
Variation on Clojure's time macro but also printing the expression that is being timed
(defmacro timed [expr]
`(let [start# (. System (nanoTime))
ret# ~expr]
(prn (str ~(str expr) " elapsed time: " (/ (double (- (. System (nanoTime)) start#)) 1000000.0) " msecs"))
ret#))
@martinklepsch
martinklepsch / dayone-ohlife-jrnl.boot
Created May 9, 2017 12:20
Parse DayOne and OhLife journal exports and save them to files that can be piped to jrnl.
;; Usage: execute each statement in a boot (http://boot-clj.com/) REPL, adjust as needed
(set-env! :dependencies '[[org.clojure/data.xml "0.2.0-alpha2"]
[clj-time "0.13.0"]])
(require '[clojure.java.io :as io]
'[clojure.data.xml :as xml]
'[clojure.string :as string]
'[clj-time.format :as f])
@martinklepsch
martinklepsch / js-patterns-externs.md
Last active April 7, 2017 10:12
Trying to compile some common JS patterns and their respective ways to extern them for Closure advanced compilation
// plain function
function add_one(x) {
  return 1 + x;
}

// constructor
MyClass = function(name) {
  this.myName = name;
};
@martinklepsch
martinklepsch / rum_system.cljs
Created January 13, 2017 06:19
Rum components to start/stop com.stuartsierra.component systems and inject them into React context.
(ns org.martinklepsch.rum-system
"Rum components to start/stop com.stuartsierra.component systems and inject them into React context."
(:refer-clojure :exclude [comp])
(:require [rum.core :as rum]
[goog.object :as gobj]
[com.stuartsierra.component :as component]))
(def context-k (-> (str ::get-sys) (subs 1)))
(def context-types {context-k js/React.PropTypes.func})
@martinklepsch
martinklepsch / oop-hickey.markdown
Created January 2, 2017 05:05
Rich Hickey on object systems

Originally posted on the mailinglist here. Mostly copied it here so I can add it to Pocket.


Here are some problems/limitations of existing OO/GF systems that I don't intend to repeat:

A) They provide only a single declaration point for all superclasses of a class B) They consider the local declaration order of superclasses to be