Skip to content

Instantly share code, notes, and snippets.

@sogaiu
sogaiu / main.janet
Last active May 6, 2021
leverage spork/regex to help transition to using pegs
View main.janet
(import spork/regex)
(comment
(regex/source "a")
# => "a"
(regex/source `\s`)
# => '(set "\n\t\r\v\f ")
View gist:40b063ffc6ab8135bb247e019cb5ca50
# instructions based on system crafters
# inside an ubuntu system (or any systemd-based system?)
cd /tmp
wget https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh
chmod +x guix-install.sh
sudo ./guix-install.sh
wget "https://sv.gnu.org/people/viewgpg.php?user_id=127547" -qO - | sudo -i gpg --import -
wget "https://sv.gnu.org/people/viewgpg.php?user_id=15145" -qO - | sudo -i gpg --import -
@sogaiu
sogaiu / gist:912914c04e1d1948d45211767334ed14
Created May 5, 2021
listview demo with kamisori's jaylib
View gist:912914c04e1d1948d45211767334ed14
(use ./build/jaylib)
(defn- make-window
"open window with default values"
[]
(set-config-flags :msaa-4x-hint)
(init-window 800 600 "Place")
(set-target-fps 60)
(set-exit-key 0))
@sogaiu
sogaiu / pretty-literals.lisp
Created May 3, 2021 — forked from rmoritz/pretty-literals.lisp
pretty hash table & vector literal syntax for common lisp
View pretty-literals.lisp
;;;; pretty-literals.lisp - pretty hash table & vector literal syntax
;;;; inspired by and uses code from http://frank.kank.net/essays/hash.html
(in-package #:pretty-literals)
;; vector literal syntax using brackets
(set-macro-character #\[
(lambda (str char)
(declare (ignore char))
(let ((*readtable* (copy-readtable *readtable* nil))
View gist:9e4c7e47353c43a18c5dc44b240c55c9
possible results
* janet source step debugger
* margaret source step debugger
* babashka source step debugger
* location or creation of clear description of edebug
* location or creation of clear description of cider debug
* location or creation of clear description of sly stepper
---
@sogaiu
sogaiu / mypr.el
Last active Apr 30, 2021
setting up s-x (super x) as prefix key in emacs
View mypr.el
;; mypr is short for "my prefix"
(defvar mypr-map (make-sparse-keymap)
"Global keymap for custom prefix commands.")
(defalias 'mypr-prefix mypr-map)
;; XXX: change "s-x" to something else if desired
(define-key global-map (kbd "s-x") 'mypr-prefix)
(define-key mypr-map "b" 'butterfly)
View seesaw-repl-tutorial.clj
; A REPL-based, annotated Seesaw tutorial
; Please visit https://github.com/daveray/seesaw for more info
;
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers
; Seesaw's basic features and philosophy, but only scratches the surface
; of what's available. It only assumes knowledge of Clojure. No Swing or
; Java experience is needed.
;
; This material was first presented in a talk at @CraftsmanGuild in
; Ann Arbor, MI.
View gist:49ef2dbd37d3b8319cc5e70dfc166326
;; Install edebug read and eval functions.
(edebug-install-read-eval-functions)
;
(defun edebug-install-read-eval-functions ()
(interactive)
(add-function :around load-read-function #'edebug--read)
(advice-add 'eval-defun :override #'edebug-eval-defun))
@sogaiu
sogaiu / gist:e5bfea37564aec0bf59a931be67a8758
Last active Apr 27, 2021
potential quotes on issues regarding documentation
View gist:e5bfea37564aec0bf59a931be67a8758
* in multiple posts:
* https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00528.html
* https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00535.html
* https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00546.html
* https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00416.html
* https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00405.html
* https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00431.html
* https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00448.html
* another: https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00743.html
@sogaiu
sogaiu / socket-repl-setup-for-clojureclr-via-an-environment-variable.md
Last active Apr 25, 2021
socket repl setup for clojureclr via an environment variable
View socket-repl-setup-for-clojureclr-via-an-environment-variable.md

Socket REPL Setup for ClojureCLR (>= 1.10) via an Environment Variable

For a *NIX-like setup (e.g. Linux, macos, etc.) it is possible to set an environment variable named clojure.server.repl for the purpose of launching a socket repl like this:

$ env clojure.server.repl="{:port,7650,:accept,clojure.core.server/repl}" bash

That starts a new bash that has an appropriate environment variable. Note that a straight-forward use of export to do this may not work.