Skip to content

Instantly share code, notes, and snippets.


Florian Margaine ralt

View GitHub Profile
View static-compile-c-file.diff
modified src/libraries.lisp
@@ -372,7 +372,7 @@ This will need to be extended as we test on more OSes."
(load-foreign-library-path name library-path search-path)))
(:or (try-foreign-library-alternatives name (rest thing) search-path))))))
-(defun %do-load-foreign-library (library search-path)
+(defun %do-load-foreign-library (library search-path type)
(flet ((%do-load (lib name spec)
(when (foreign-library-spec lib)
(with-slots (handle pathname) lib
ralt /
Last active Sep 21, 2020
horse-html: extension to Parenscript

My main gripe with who-ps-html is that it generates a string, which means that you don't have a real DOM object to play with; you must wait to render that object before being able to do things on it.

horse-html fixes that by generating real DOM elements in JavaScript, and returning those.

The absolute best feature of horse-html is that the closures also magically work. If you define an onclick on an element, the JavaScript will use the closures generated wherever your code is defining that onclick attribute.

PS: the code can definitely be improved. I suck. But for the little use cases I have, it works. Feedback definitely welcome. I'm notably not a fan of the nested functions, but couldn't figure out a better way.

ralt / foo.lisp
Last active Mar 14, 2020
Parenscript async/await support
View foo.lisp
(ps::defprinter ps-js::await (x)
(ps::psw (string-downcase "(await "))
(ps::print-op-argument 'ps-js::await x)
(ps::psw ")"))
await ps-js::await)
(ps::define-statement-operator async-defun (name lambda-list &rest body)
(multiple-value-bind (effective-args body-block docstring)
ralt /
Last active Mar 20, 2020
my eshell config


eshell is the shell I’ve tried using over time, and in the end just never stick with it. Let’s try one more time with a couple of tricks. The first tricks are mostly documentation:

  • M-& in a tramp-aware session means you run commands in a new buffer, without a TTY. Great for things like tailf.
  • for ncurses-like applications, “visual commands” is the missing context. Applications like top are in the default list by default,
ralt /
Last active Jul 6, 2019
How to make bluetooth flawless in gnome shell
#!/usr/bin/env bash
# This shell script setups bluetooth to be flawless in gnome shell.
# Devices are now instantly connected when they're near the laptop.
# (It probably works as a service for random WMs too.)
# The issue is essentially that gnome-bluetooth is issuing the wrong
# dbus calls to connect the device immediately; org.bluez gets EAGAIN
# from the kernel when it processes gnome-bluetooth dbus calls (until
# it eventually succeeds, 20-30s later). However, bluetoothctl is
ralt /
Last active Jul 9, 2018
Slow down stdout
#!/usr/bin/env python
import gevent.monkey; gevent.monkey.patch_all()
import os.path
import sys
import tempfile
import threading
import time
ralt / 000.mkd
Created Feb 25, 2018 — forked from packz/000.mkd
Static cryptsetup
View 000.mkd

I suppose you use Debian-like systems

$ mkdir rootdir && cd rootdir && export ROOTDIR=$PWD
$ apt-get source libdevmapper1.02.1
$ apt-get source cryptsetup
ralt / stumpwmrc.lisp
Created Nov 24, 2017
StumpWM integration with password store, aka "pass"
View stumpwmrc.lisp
(defun pass-entries ()
(let* ((home (merge-pathnames #p".password-store/" (user-homedir-pathname)))
(home-ns-len (length (namestring home))))
(lambda (entry)
(let ((entry-ns (namestring entry)))
(subseq entry-ns home-ns-len (- (length entry-ns) 4))))
(directory (make-pathname :directory `(,@(pathname-directory home)
:name :wild
View gist:ed0a6f1ad52a946e7a1822ef679fa91a
modified src/tests/
@@ -1,12 +1,13 @@
# -*- Mode: Makefile; indent-tabs-mode: nil -*-
# vim: set filetype=makefile tabstop=8 shiftwidth=4 expandtab:
.PHONY: all
View gist:a5363283772869cb307cc0e68b5ef750

root.tar.gz is an 8MB file.


CL-USER> (time (ironclad:digest-file :sha256 "../root.tar.gz"))
Evaluation took:
  0.072 seconds of real time
  0.071849 seconds of total run time (0.071849 user, 0.000000 system)
  100.00% CPU
You can’t perform that action at this time.