Skip to content

Instantly share code, notes, and snippets.

View ceving's full-sized avatar
💭
Ejaculating

ceving

💭
Ejaculating
View GitHub Profile
@ceving
ceving / WASM-Instructions_in_JSON.md
Last active January 15, 2024 14:54
WASM Instructions in JSON
@ceving
ceving / Vererbung ist nicht schlecht.md
Created December 31, 2023 13:02
Vererbung ist nicht schlecht

Vererbung ist nicht schlecht

Nur die schlampige Verwendung von Sprache ist schlecht.

Seit ein paar Jahren macht sich in der Programmierwelt das Mantra breit, Vererbung sei schlecht und solle besser nicht verwendet werden[1]. Ich halte das für eine unangemessene Vereinfachung der Problematik.

Das Mantra wird durch das Liskovsche

@ceving
ceving / enum.mjs
Created December 22, 2023 13:06
JavaScript Enum
export class Enum
{
static Item = class
{
#name;
#enumeration;
constructor(name, enumeration)
{
this.#name = name;
@ceving
ceving / Reactive DOM with VanJS.js
Last active December 21, 2023 21:40
Reactive DOM with VanJS
import van from "./van-1.2.7.min.js"
const {p, button} = van.tags;
const love = van.state(true);
van.add(
document.body,
p("She loves me",
() => { return love.val ? "" : " not"; }, // empty string is necessary
@ceving
ceving / .emacs.d prolog.el
Last active December 16, 2023 14:04
Some keybindings for Prolog in Emacs
(defun inferior-prolog-proc ()
(get-buffer-process (prolog-inferior-buffer)))
(defun inferior-prolog-get-clause ()
(buffer-substring-no-properties (prolog-clause-start)
(prolog-clause-end)))
(defun inferior-prolog-send-read ()
"Send a char read from minibufer."
(interactive)
@ceving
ceving / Racket-Turtle.md
Last active December 7, 2023 09:13
Racket-Turtle
@ceving
ceving / Current Debian sources for main and testing.md
Created November 29, 2023 08:20
Current Debian sources for main and testing

Current Debian sources for main and testing

  • stable: bookworm
  • testing: trixie

/etc/apt/apt.conf.d/99defaultrelease

APT::Default-Release "bookworm";
@ceving
ceving / church-numerals.scm
Created November 27, 2023 07:36
Church Numerals Scheme
(define-syntax numeral
(syntax-rules ()
((_ i s body)
(lambda (i)
(lambda (s)
body)))))
(define zero (numeral i s s))
#;
@ceving
ceving / church-numerals.js
Last active November 26, 2023 15:47
Church Numerals JavaScript
// Implementation independant
const Z =
(inc) => (zero) => zero;
const S =
(n_times) =>
(inc) => (zero) => inc(n_times(inc)(zero));
const add2 =
@ceving
ceving / Send 'End of Transmussion' to the Scheme process in Emacs.md
Last active November 19, 2023 09:42
Send 'End of Transmussion' to the Scheme process in Emacs

In case of an error Gambit and Guile automatically enter a debugger. In order to leave the debugger it is necessary to press Ctrl-d, which sends the Unicode character 'End of Transmission' (ASCII 0x04 EOT) to the Scheme process. It is necessary to switch buffers for this, becuse "C-d" has a different meaning in the scheme-mode. The following definition extends the scheme-mode by adding the key binding "C-c C-d", which sends EOT to Scheme process.

(defun scheme-send-end-of-transmission ()
  "Send Unicode 'End of Transmussion' to the Scheme process."
 (interactive)