Skip to content

Instantly share code, notes, and snippets.

@ctsrc
ctsrc / install_fbsd_13_2_hetzner.md
Last active March 27, 2024 09:31
Install FreeBSD 13.2 on Hetzner

Install FreeBSD 13.2 on Hetzner server

Hetzner no longer offers direct install of FreeBSD, but we can do it ourselves. Here is how :)

Boot the hetzner server in Hetnzer Debain based rescue mode. ssh into it. then:

wget https://mfsbsd.vx.sk/files/iso/13/amd64/mfsbsd-13.2-RELEASE-amd64.iso

qemu-system-x86_64 \
@oantolin
oantolin / contrast.c
Last active August 17, 2023 21:30
Find most luminous contrasting color
#include <math.h>
#include <stdio.h>
double f(int c) {
double x = c / 255.0;
return x<=0.03928 ? x/12.92 : pow((x + 0.055)/1.055, 2.4);
}
double rellum(int r, int g, int b) {
return 0.2126*f(r) + 0.7152*f(g) + 0.0722*f(b);
(ql:quickload "cl-ppcre")
(ql:quickload "anaphora")
(defpackage :ini-parser
(:use :common-lisp :anaphora)
(:export :read-config-from-file))
(in-package :ini-parser)
(defparameter +empty-line+ (format nil "~%"))
@lispm
lispm / queens.lisp
Last active February 3, 2020 17:58
;;; Paper: https://arxiv.org/pdf/2001.02491.pdf
;;; Code: https://github.com/cvlab-epfl/n-queens-benchmark
;;; Lisp Code: https://github.com/cvlab-epfl/n-queens-benchmark/blob/master/code/queens.lisp
;;; Changes/extensions to the original Common Lisp code: Rainer Joswig, joswig@lisp.de, 2020
;; * using bitvectors is faster than 'boolean' arrays (which typically aren't supported in CL)
;;; In Common Lisp
;;; * use Quicklisp
;;; * compile and load this file
@priyadarshan
priyadarshan / README.md
Last active January 3, 2020 16:36
Install WSL/Debian and tools

To select Debian as default distro:

wslconfig /s debian
@phoe
phoe / package-local-nicknames.md
Last active February 27, 2024 08:14
Package-local nicknames in Common Lisp - a semishitpost about PLNs

Package-local nicknames in Common Lisp

Warning: this is a rant.

Warning: you have been warned.

Note: actually worthwhile content starts in the second subsection. You are free to skip the first one.

Story time

@Goheeca
Goheeca / init.slime
Last active August 29, 2022 11:01
Clean SLIME REPL
(ql:quickload "agnostic-lizard")
@Goheeca
Goheeca / shared.lisp
Last active November 17, 2019 18:45
Multiprocess multithreaded computation with SBCL
#!/usr/bin/sbcl --script
(require :sb-posix)
(require :sb-bsd-sockets)
;;; Globals
;; IPC
(defvar *pid* nil)
(defvar *socket-path* "/tmp/socket")
(defvar *socket* nil)
;; MT
@Goheeca
Goheeca / braille-pixels.lisp
Last active November 17, 2019 18:36
Braille pixels images using cl-charms (@ SBCL)
#!/usr/bin/sbcl --script
#|
Usage
=====
$ ./braille-pixels.lisp [path]
Main
====
@Goheeca
Goheeca / ambiguous.pyjs
Last active November 17, 2019 18:52
Common Lisp ≡ ⊤
#||| Python or JS that is the question. |#
#|| Let's define a JS function, provided we're in JS. |#
#+moody-js"
function fact(n) {
if (n == 0) return 1
else return n * fact(n - 1)
}
"