Skip to content

Instantly share code, notes, and snippets.

Arne Brasseur plexus

Block or report user

Report or block plexus

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 jstack.txt
2019-04-16 16:13:34
Full thread dump OpenJDK 64-Bit Server VM (25.191-b12 mixed mode):
"Attach Listener" #17 daemon prio=9 os_prio=0 tid=0x00007fd38c001000 nid=0x7c78 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"DestroyJavaVM" #16 prio=5 os_prio=0 tid=0x00007fd3d999d000 nid=0x72e2 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"clojure.core/tap-loop" #15 daemon prio=5 os_prio=0 tid=0x00007fd378038000 nid=0x7523 waiting on condition [0x00007fd3c06f5000]
View streaming_20190310.md

Adding a higher level API to Trikl

Streaming Sunday afternoon at https://www.youtube.com/c/LambdaIsland/live

Towards the end of last year I created Trikl (https://github.com/lambdaisland/trikl), a library for building rich terminal interfaces that's modeled after Reagent. You write components using a variant of Hiccup, and trikl takes care of rendering them, applying smart diffing to minimize the amount of updates to send to the terminal, assuring updates always look smooth.

View invoice.rb
# coding: utf-8
$:.unshift '/home/arne/github/kramdown/lib'
require 'fileutils'
require 'prawn'
require 'kramdown'
require 'json'
CURRENCIES = {
'EUR' => '€ %.2f',
View clj_ns_buffer_names.el
;; Rename clj/cljs/cljc buffers to their namespace name, so you see
;; `foo.bar.core' in the modeline, rather than `core.clj'
(advice-add 'rename-buffer :around #'plexus/clj-ns--rename-buffer-advice)
(defun plexus/clj-ns--rename-buffer-advice (rb-fun newname &optional unique &rest args)
(let ((filename (buffer-file-name (current-buffer)))
(buf-start (buffer-substring-no-properties (point-min) (point-min))))
(if (and (string-match "\\.clj[cxs]?$" filename)
(string-match "(ns \\([^\n )]+\\)" buf-start))
(match-string-no-properties 1 buf-start)
View .emacs
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (package-initialize)
(setq chemacs-profiles-path "~/.emacs-profiles.el")
(when (not (file-exists-p chemacs-profiles-path))
(with-temp-file chemacs-profiles-path
(insert "((\"default\" . ((user-emacs-directory . \"~/.emacs.d\"))))")))
View generate_docs
#!/bin/bash
# Keep a separate branch of generated API docs.
#
# This script generates API documentation, commits it to a separate branch, and
# pushes it upstream. It does this without actually checking out the branch,
# using a separate working tree directory, so without any disruption to your
# current working tree. You can have local file modifications, but the git index
# (staging area) must be clean.
View async.clj
(ns slacker.async)
(defmacro promise
"Creates a promise. Takes a binding form which binds the [resolve reject]
callbacks.
(promise [res rej]
(res 42))"
{:style/indent 1}
[bindings & body]
View async.clj
(ns slacker.async)
(defmacro promise
"Creates a promise. Takes a binding form which binds the [resolve reject]
callbacks.
(promise [res rej]
(res 42))"
{:style/indent 1}
[bindings & body]
View Code.gs
if(typeof Math.imul == "undefined" || (Math.imul(0xffffffff,5) == 0)) {
Math.imul = function (a, b) {
var ah = (a >>> 16) & 0xffff;
var al = a & 0xffff;
var bh = (b >>> 16) & 0xffff;
var bl = b & 0xffff;
// the shift by 0 fixes the sign on the high part
// the final |0 converts the unsigned value into a signed value
return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0);
}
You can’t perform that action at this time.