Skip to content

Instantly share code, notes, and snippets.

https://www.reddit.com/r/Trackballs/wiki/index/
https://gemst.co.kr/pcacc/?q=YToxOntzOjEyOiJrZXl3b3JkX3R5cGUiO3M6MzoiYWxsIjt9&bmode=view&idx=16642405
@sogaiu
sogaiu / gist:c5c4a5a9cfd4e3a446e07b6417b324d3
Last active March 3, 2024 05:55
elpaca, straight, package, etc.
https://www.reddit.com/r/emacs/comments/19bs8w9/elpaca_vs_straightel/
https://www.reddit.com/r/emacs/comments/13caudx/if_you_like_straight_you_should_try_elpaca/
https://www.reddit.com/r/emacs/comments/11daqsz/elpaca_the_basics/
https://github.com/progfolio/elpaca/wiki/Migrating-to-Elpaca
@sogaiu
sogaiu / elpaca-startup.el
Last active March 1, 2024 12:57
partially analyzed elpaca startup code
;; going to assume for concreteness that `user-emacs-directory` is "~/.emacs.d"
(defvar elpaca-installer-version 0.6)
;; "~/.emacs.d/elpaca"
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
;; "~/.emacs.d/elpaca/builds"
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
;; "~/.emacs.d/elpaca/repos"
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
;; used in the `let` binding below and on the very last line
@sogaiu
sogaiu / janet-lang-org-repos-ideas.md
Last active March 1, 2024 04:10
janet-lang.org repository ideas
  • ideas about using different components

    • transition from mendoza to spork/mdz?
      • in the process enhance / modify / test out spork/mdz?
    • transition from circlet to spork/http*?
      • in the process enhance / modify / test out spork/http*?
    • transition from Makefile to project.janet?
      • multiplatform - more usable by windows users?
  • should file-watching capability of some sort be provided?

  • could that piece end up in spork?

@sogaiu
sogaiu / mendoza-questions.md
Last active March 1, 2024 03:49
mendoza questions
  • how does :order work and can non-integers be used? based on mendoza/sitemap.janet, it seems like non-integers should be usable.

  • the watching seems a bit flaky -- i.e. making changes to .mdz files doesn't always appear to lead to regenerated content. at least with fswatch. inotifywait seemed to give better results. not sure if watchful would be better in some cases...eye works on windows and it seems to claim portability so that might be one path toward cross-platformness. though perhaps these remarks are more geared toward what janet-lang.org's repository might provide.

  • what do various files do?

    • mdz - cli with various subcommand (e.g. build, clean, server, watch, etc.)
    • mendoza/init.janet - connects other pieces and provides the init, clean, serve, build, and watch functions -- it's what mdz imports
  • mendoza/markup.janet - provides markup, a function that parses mendoza marku

@sogaiu
sogaiu / gist:422a8a3e53c2045408b31f5c4a2592e9
Created February 29, 2024 11:50
windows 11 iso use to access partitions (e.g. to copy drivers to partition when no network or usb drives work in windows)
at the windows setup dialog, press shift-f10 to start a command prompt
at the command prompt, start the diskpart command, then list volumes:
DISKPART> list volume
find the windows partition, suppose it is volume number 1
if it has something in the Ltr column (e.g. D), exit diskpart and
switch to the directory (e.g. D:)
@sogaiu
sogaiu / gist:8bc7c0c8befacc61e2db6a6ae13d4788
Created February 29, 2024 06:59
scanner.c by size, small -> large
545 github.com/yuja/tree-sitter-qmljs/src/scanner.c
561 github.com/tree-sitter/tree-sitter-typescript/tsx/src/scanner.c
603 github.com/tree-sitter/tree-sitter-typescript/typescript/src/scanner.c
651 github.com/stsewd/tree-sitter-comment/src/scanner.c
659 github.com/ObserverOfTime/tree-sitter-xml/tree-sitter-dtd/src/scanner.c
910 github.com/tree-sitter/tree-sitter-ocaml/interface/src/scanner.c
917 github.com/gleam-lang/tree-sitter-gleam/src/scanner.c
956 github.com/leo60228/tree-sitter-pioasm/src/scanner.c
989 github.com/tree-sitter/tree-sitter-ocaml/ocaml/src/scanner.c
1008 github.com/stsewd/tree-sitter-rst/src/scanner.c
@sogaiu
sogaiu / functions-in-loops.janet
Last active February 29, 2024 02:33
investigating functions defined in loops
(disasm (fn [] (for i 0 2 (defn my-fn [x] (+ x 1)))))
# =>
'{:arity 0
:bytecode @[(ldi 0 0)
(ldi 1 2)
(clo 2 1)
(call 2 2)
(retn)]
:constants @[]
:defs @[{:arity 1
@sogaiu
sogaiu / janet.ctags
Last active February 28, 2024 09:36
~/.ctags.d/janet.ctags -- for indexing top-level things in janet code -- usage: `ctags -R <dir>` or for emacs, `ctags -e -R <dir>` -- sorry, no destructuring support
--exclude=.git
--langdef=Janet
--langmap=Janet:.janet
--regex-janet=/^\([ \t]*def[ \t]+([^0-9:#][^ \t\[{(]+)/\1/D/
--regex-janet=/^\([ \t]*def-[ \t]+([^0-9:#][^ \t\[{(]+)/\1/d/
--regex-janet=/^\([ \t]*defglobal[ \t]+([^0-9:#][^ \t\[{(]+)/\1/g/
--regex-janet=/^\([ \t]*defmacro[ \t]+([^0-9:#][^ \t\[{(]+)/\1/M/
--regex-janet=/^\([ \t]*defmacro-[ \t]+([^0-9:#][^ \t\[{(]+)/\1/m/
--regex-janet=/^\([ \t]*defn[ \t]+([^0-9:#][^ \t\[{(]+)/\1/N/
--regex-janet=/^\([ \t]*defn-[ \t]+([^0-9:#][^ \t\[{(]+)/\1/n/
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1 0x00007f49d9c8b81f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2 0x00007f49d9c3d432 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3 0x00007f49d9c264b4 in __GI_abort () at ./stdlib/abort.c:79
#4 0x00007f49d9c2731d in __libc_message (fmt=fmt@entry=0x7f49d9d9cdc0 "Fatal glibc error: %s:%s (%s): assertion failed: %s\n")
at ../sysdeps/posix/libc_fatal.c:150
#5 0x00007f49d9c35e83 in __libc_assert_fail (
assertion=assertion@entry=0x7f49d9d9e860 "(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)", file=file@entry=0x7f49d9d991b9 "malloc.c", line=line@entry=2594,
function=function@entry=0x7f49d9d9f0c0 <__PRETTY_FUNCTION__.8> "sysmalloc") at ./assert/__libc_assert_fail.c:31
#6 0x00007f49d9c