Skip to content

Instantly share code, notes, and snippets.

@sogaiu
sogaiu / termios-various.md
Last active July 23, 2024 12:18
termios struct for various operating systems
@sogaiu
sogaiu / gist:3e40baeea124a7de64a015496c0b046b
Created July 23, 2024 04:20
setting up new account in windows 10/11 home with certain settings in place
* account settings
* info leakage prevention
* browser settings
* info leakage prevention
@sogaiu
sogaiu / gist:8e082ff28fffa839990ed7b40673d905
Created July 23, 2024 03:33
literal bracket tuple as argument to function
$ janet
Janet 1.35.2-771956b5 linux/x64/gcc - '(doc)' for help
repl:1:> (disasm (fn [] (printf "%j" [:a])))
{:arity 0
:bytecode @[(ldc 0 0) (ldc 1 1) (push2 0 1) (ldc 0 2) (tcall 0)]
:constants @["%j" (:a) <cfunction printf>]
:defs @[]
:environments @[]
@sogaiu
sogaiu / gist:703b13ef2f3bf71a915e4dd42be11b5d
Created July 22, 2024 11:46
firefox link usage via keyboard...
https://lists.gnu.org/archive/html/emacs-orgmode/2016-04/msg00277.html
try typing single quote followed by text to match a link to follow...
@sogaiu
sogaiu / gist:376a7908ebdef8aed13d960b04c5498a
Last active July 19, 2024 12:30
spork/path relpath for windows exploration
$ janet
Janet 1.35.2-771956b5 linux/x64/gcc - '(doc)' for help
repl:1:> (import spork/path)
@{_ @{:value <cycle 0>} path/abspath @{:private true} path/abspath? @{:private true} path/basename @{:private true} path/delim @{:private true} path/dirname @{:private true} path/ext @{:private true} path/join @{:private true} path/normalize @{:private true} path/parts @{:private true} path/posix/abspath @{:private true} path/posix/abspath? @{:private true} path/posix/basename @{:private true} path/posix/delim @{:private true} path/posix/dirname @{:private true} path/posix/ext @{:private true} path/posix/join @{:private true} path/posix/normalize @{:private true} path/posix/parts @{:private true} path/posix/relpath @{:private true} path/posix/sep @{:private true} path/relpath @{:private true} path/sep @{:private true} path/win32/abspath @{:private true} path/win32/abspath? @{:private true} path/win32/basename @{:private true} path/win32/delim @{:private true} path/win32/dirname @{:private true} path/win32/ext @{:priva
@sogaiu
sogaiu / pth.janet
Last active July 21, 2024 13:23
work on "expanding" spork/path
# based on code from spork/path by bakpakin
# https://en.wikipedia.org/wiki/Path_(computing)
# unclear whether unc paths should be covered or not
(defn abspath?
[path &opt doze?]
(default doze? (= :windows (os/which)))
(if doze?
@sogaiu
sogaiu / 1.35.2-342a29c7.txt
Created July 18, 2024 01:27
arnie results
$ ./arnie bench `which janet`
@{"/home/user/.local/bin/janet" @{ "benchmarks/binarytrees/binarytrees1.janet" @[(0 1721265038.71622 1721265038.71982)] "benchmarks/fannkuch/fannkuch1.janet" @[(0 1721265023.07978 1721265029.87274)] "benchmarks/fannkuch/fannkuch2-in.janet" @[(0 1721265013.3833 1721265018.01945)] "benchmarks/fannkuch/fannkuch2.janet" @[(0 1721265032.8012 1721265038.71622)] "benchmarks/fannkuch/fannkuch2b.janet" @[(0 1721265022.04114 1721265022.04885)] "benchmarks/fannkuch/fannkuch3.janet" @[(0 1721265029.87276 1721265032.80118)] "benchmarks/fannkuch/fannkuch4-bakpakin.janet" @[(0 1721265009.56453 1721265013.38328)] "benchmarks/fannkuch/fannkuch4-parallel.janet" @[(0 1721265022.04885 1721265023.07976)] "benchmarks/fannkuch/fannkuch4.janet" @[(0 1721265018.01946 1721265022.04113)] "benchmarks/fannkuch/fannkuch5.janet" @[(0 1721265007.22588 1721265009.56453)] "benchmarks/knucleotide/knucleotide.janet" @[(0 1721265038.96106 1721265039.14689)] "benchmarks/knucleotide/knucleotide2.janet" @[(0 1721265038
@sogaiu
sogaiu / trial1.txt
Last active July 17, 2024 12:14
janet-benchmarksgame additional output using branch on fork
$ janet runbench.janet benchmark_runs/bench_twojanets.jdn > results
name,janet,janet-bt
fannkuch,3.51,3.52
binarytrees,79.5,76.99
knucleotide,178.42,177.57
nbody,15.39,15.68
reverse-complement,35.59,35.72
pidigits,4.97,4.97
regexredux,14.11,14.25
@sogaiu
sogaiu / 1.35.2-342a29c7.txt
Created July 17, 2024 08:48
janet-benchmarksgame runbench.janet output
$ janet runbench.janet benchmark_runs/bench_pylua.jdn >t1
name,janet,python,lua
fannkuch,3.51,3.66,1.42
binarytrees,72.4,72.73,95.63
knucleotide,175.27,163.34,62.53
nbody,16.85,22.13,8.56
reverse-complement,35.49,8.02,36.29
pidigits,5.21,3.28,nan
regexredux,14.37,10.82,nan