Skip to content

Instantly share code, notes, and snippets.

Martin Klepsch martinklepsch

Block or report user

Report or block martinklepsch

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
martinklepsch /
Last active Mar 25, 2020
A very minimal Emacs configuration to get started with Emacs & Evil-mode

A Starting Point for using Emacs & Evil-mode

(I wrote a bit about why Emacs and Vim on my blog and thought it might be nice to give some starting point for people that want to try it.)

If you just want to play around with Emacs & Evil mode do the following:

  1. mkdir ~/.emacs.d/
  2. copy init.el into ~/.emacs.d/
  3. Download Emacs from
View reagent-autoscroll.cljs
;; Auto-scrolling ==============================================================
(defn scroll! [el start end time]
(.play (goog.fx.dom.Scroll. el (clj->js start) (clj->js end) time)))
(defn scrolled-to-end? [el tolerance]
;; at-end?: element.scrollHeight - element.scrollTop === element.clientHeight
(> tolerance (- (.-scrollHeight el) (.-scrollTop el) (.-clientHeight el))))
(defn autoscroll-list [{:keys [children class scroll?] :as opts}]
martinklepsch / client.clj
Last active Jan 30, 2020
A minimal Clojure client for's HTTP API.
View client.clj
(ns oxygen.client
"A minimal Clojure client for's HTTP API.
Supports retrieval of whole tables as well as individual records.
Dependencies: [org.clojure/data.json \"0.2.6\"] [clj-http \"2.0.0\"]"
(:require [ :as json]
[clojure.string :as string]
[clojure.set :as set]
[clj-http.client :as client]))
(def api-base "")
martinklepsch / login_blocking.markdown
Last active Oct 10, 2019
`login` blocking indefinitely
View login_blocking.markdown

More context:

$ sudo dtruss login
dtrace: system integrity protection is on, some features will not be available
dtrace: failed to execute login: dtrace cannot control executables signed with restricted entitlements

In my ~/.tmux.conf I had a line like this:

set-option -g default-command "reattach-to-user-namespace -l fish"
martinklepsch / boot_sentry.clj
Created May 15, 2019
Boot tasks and helper functions to create Sentry releases and attach source maps to them
View boot_sentry.clj
(ns dev.boot-sentry
(:require [boot.util :as util]
[boot.core :as boot]
[ :as json]
[org.httpkit.client :as http]))
(def sentry-key "abc")
(def org "my-org")
(def project "frontend")
(def test-release "test-release-delete-me")
martinklepsch /
Created Apr 22, 2010
Simple script to reconnect your
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Instruct an AVM FRITZ!Box via UPnP_ to reconnect.
This is usually realized with tools like Netcat_ or cURL_. However, when
developing in Python_ anyway, it is more convenient to integrate a native
implementation. This one requires Python_ 2.5 or higher.
UPnP_ (Universal Plug and Play) control messages are based on SOAP_, which is
martinklepsch /
Last active Nov 12, 2018
Notes about fixing analysis issues with ClojureScript 1.10.439

How to analyze-file with foreign-lib dependencies?

  • I'm trying to figure out how to analyze a file that depends on react (via CLJSJS)
  • Previously would analyze with *analyze-deps* set to false
  • With 1.10.439 this no longer works. (Dynamic vars can't be resolved, see old description below)
  • With *analyze-deps* set to true I need to properly supply the foreign lib information but I can't figure out how.


When calling cljs.analyzer.api/analyze-file with the state-as-first-arg arity it calls cljs.env/with-compiler-env which shadowed my own binding described in Current Approach section. I was unaware that analyzer.api/empty-state is actually just a compiler env as well so creating the right compiler env and passing it to analyze-file solved all issues:

SQLite version 3.24.0 2018-06-04 14:10:15
Enter ".help" for usage hints.
sqlite> .schema
  date        TEXT,
martinklepsch / logging.cljc
Last active Oct 22, 2018
simple Clojurescript logging using Google Closure logging tools
View logging.cljc
;; This previously was CLJX but has now been updated to use cljc. Thanks @caskolkm
(ns app.logging
(:refer-clojure :exclude [time])
(:require #?(:clj [ :as log]
:cljs [goog.log :as glog]))
#?(:cljs (:import goog.debug.Console)))
View pathom-cljdoc.clj
(ns cljdoc.pathom3
(:require [com.wsscode.pathom.core :as p]
[com.wsscode.pathom.connect :as pc]
[clojure.core.async :as async]
[cljdoc.util.repositories :as repos]
[cljdoc.util.pom :as pom]
[cljdoc.config :as config]
[ :as cljdoc-sqlite]))
You can’t perform that action at this time.