Skip to content

Instantly share code, notes, and snippets.

@zilti
zilti / example.clj
Created March 9, 2020 21:35
Self-contained clojure program demonstrating how trying to edit a table cell causes infinite spam of CellEditEvents
#!/bin/sh
#_(
DEPS='
{:deps {org.clojure/clojure {:mvn/version "1.10.1"}
cljfx {:mvn/version "1.6.5"}}}
'
OPTS=''
exec clj $OPTS -Sdeps "$DEPS" "$0" "$@"
)
@zilti
zilti / etc_pam.d_common-session
Created February 7, 2019 12:08
OpenSUSE eCryptFS PAM
#%PAM-1.0
#
# This file is autogenerated by pam-config. All changes
# will be overwritten.
#
# Session-related modules common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define tasks to be performed
# at the start and end of sessions of *any* kind (both interactive and
@zilti
zilti / PrincipiaError
Created February 6, 2019 19:49
Prinicpia Error Log
Log file created at: 2019/02/06 20:45:10
Running on machine: lyriondesktop
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
E0206 20:45:10.861512 21477 ephemeris_body.hpp:845] New Apocalypse: INVALID_ARGUMENT: Error extending trajectory for Adrastea. Error trying to fit a smooth polynomial to the trajectory. The approximation error jumped from +1.00000000000000002e-03 m to +2.20807567213433236e+08 m at time -1.57787520000000000e+09 s. The last position is {+6.63467939054516449e+10 m, +5.43501466695274506e+10 m, +3.07659575804323807e+10 m} and the last velocity is {+1.76343414987203293e+07 m s^-1, +1.43827566544367932e+07 m s^-1, +8.15714472457679734e+06 m s^-1}. An apocalypse occurred and two celestials probably collided because your solar system is unstable.
E0206 20:45:10.861645 21477 ephemeris_body.hpp:845] New Apocalypse: INVALID_ARGUMENT: Error extending trajectory for Amalthea. Error trying to fit a smooth polynomial to the trajectory. The approximation error jumped from +1.0000000000
@zilti
zilti / AppRun
Last active March 23, 2019 17:57
AppImage creation script for CKAN
#!/usr/bin/env bash
HERE="$(dirname "$(readlink -f "${0}")")"
echo $HERE
export PATH=${HERE}/usr/sbin:${HERE}/usr/bin:$PATH
export LD_LIBRARY_PATH=$HERE/usr/lib64:$HERE/usr/lib:$HERE/lib64:$LD_LIBRARY_PATH
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH:$DYLD_FALLBACK_LIBRARY_PATH
export LD_RUN_PATH=$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=$HERE/usr/lib64/pkgconfig:$PKG_CONFIG_PATH
export MONO_GAC_PREFIX=${HERE}
export MONO_PATH=${HERE}/usr/lib/mono/4.5
@zilti
zilti / core.clj
Created October 28, 2018 21:19
Nested macro vs. macro plus function with eval
;; This approach works as intended:
(defn- connect-fn [instance iface method args & code]
(eval `(proxy [~iface] []
(~(symbol (.getName method)) ~args
~@code))))
(defmacro connect [instance method args & code]
`(let [functional-method# (first (clojure.lang.Reflector/getMethods (class ~instance) 1 ~(str "set" (camelcase (name method))) false))
functional-para# (symbol (.getName (first (.getParameterTypes ^Method functional-method#))))]
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.15'
}
}
@zilti
zilti / dump.zip.base64
Created November 23, 2016 05:23
MoarVM compilation core dump
UEsDBBQAAAAIAMAwd0kBj4fdnPUHAKCINgAJABwAbW9hci5jb3JlVVQJAAO4IzVYI8QzWHV4
CwABBOgDAAAEZAAAAOyde3RTVb7HT/oMLZSACIWKHLDMFJyWdEQoL01LK+nYQldbnDoKJG1D
E8nLJC3F0TFDwSkWJDPOvdalg/Hde0e98aJOx2cQlLp0xqCjU3WNE2f5CHPViYNCHYHcfc75
7WTv3X0anT/mruvKb5G1z97n+/nt336dfZJ1TrmxruGyLI1GwJYjXCKkcoJgEMabQagS9sOx
pM1Fn0DtRAQyEVJdissjOZ2JkhuLaD3LjTZjZXDalb4UN5bARxouF2nGrbub4ooXQ3mIz8Wu
z4Lz91CcG8ep0r62AeAiNCfOh4M4n+t9CLjwvRQXWwDxGfhxml7NBuX9FBc+Fw70/PrED4DT
38/UBwcGPqfV5igFbpoL5eCG8rnhySAI0JzBDwfuAi43thc7DlHc6M/xkcq4n58L5x+luKSp
zLMkp6O5OHbn53PhUhAEaK7seXyUxeViH2LuIM3lwYGJX5/uE+DiNBfA011lngU/BS76GMVp
MSfy+3Pob7gDnqC4KsyF+PVFcceFaK4JukOI8Dn9CeD8v6HXXykc+FXaNwt33DDFjeD6mvic
dQ5wTTSnvxYOVPplcAA492/p+vD1w53N5UzaSUpB9Gn6uqSdOM5eHXD6Z+j+nKKZMM6RubC+
@zilti
zilti / sawinlist.el
Created October 24, 2016 15:22
Emacs script to interact with the Sawfish window manager. See http://sawfish.wikia.com/wiki/Sawinlist for more infos.
;;; sawinlist.el --- functions for listing and manipulating x-windows managed by sawfish
;; Copyright (C) 2011 , 2012 by the author: John Lumby [email protected]
;; This file may be used in conjunction with GNU Emacs.
;; Both this file and GNU Emacs are free software; you may redistribute them and/or modify
;; them under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
@zilti
zilti / build.boot
Created January 8, 2015 00:10
Failed type check
;-*- mode: Clojure;-*-
(set-env!
;;:source-paths #{"src"}
:repositories {"clojars.org" "https://clojars.org/repo/"
"central" "http://repo1.maven.org/maven2/"
"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"}
:dependencies '[[org.clojure/clojure "1.7.0-alpha4"]
[sonian/carica "1.1.0" :exclusions [cheshire]]
[environ "1.0.0"]
[clj-time "0.9.0"]
@zilti
zilti / Stacktrace
Last active August 29, 2015 14:02
core.typed fails to properly load protocols
Initializing core.typed ...
Building core.typed base environments ...
Finished building base environments
"Elapsed time: 4453.814043 msecs"
core.typed initialized.
Start collecting broken-protocol.core
Start collecting broken-protocol.other
Finished collecting broken-protocol.other
Finished collecting broken-protocol.core
Collected 2 namespaces in 4806.79317 msecs