Skip to content

Instantly share code, notes, and snippets.

View aartaka's full-sized avatar
💡
Stuplime programming

Artyom Bologov aartaka

💡
Stuplime programming
View GitHub Profile
@kchanqvq
kchanqvq / flex.lisp
Last active December 18, 2021 21:18
simple flex score function for nyxt
(in-package :prompter)
(defun score-suggestion-string (input suggestion-string)
(let ((i 0)
(score 0.0))
(declare (optimize (speed 3) (safety 0))
(type single-float score) (type fixnum i)
(type (simple-array character) input suggestion-string))
(loop for c across input do
(let ((next (position c suggestion-string :start i :test 'eq)))
(if next
@markasoftware
markasoftware / html.lisp
Last active June 16, 2024 02:08
html->string (Super simple HTML templating for Lisp)
;; Copyright (c) 2020 Mark Polyakov
;; Released under the WTFPL (Do What The Fuck You Want To Public License)
(defvar *html-void-tags* '(:area :base :br :col :embed :hr :img :input :link
:meta :param :source :track :wbr)
"String designators for self-closing/void tags.
https://html.spec.whatwg.org/multipage/syntax.html#void-elements")
(defvar *html-escapes*
'(#\> ">"
@ghedo
ghedo / sound_playback.c
Last active May 9, 2025 07:59
Simple sound playback using ALSA API and libasound
/*
* Simple sound playback using ALSA API and libasound.
*
* Compile:
* $ cc -o play sound_playback.c -lasound
*
* Usage:
* $ ./play <sample_rate> <channels> <seconds> < <file>
*
* Examples: