Skip to content

Instantly share code, notes, and snippets.

View Aeva's full-sized avatar

Aeva Aeva

View GitHub Profile
(use-modules (srfi srfi-1))
;; "record-types" will end up looking something like this:
;;
;; ((camera (matrix #:mat4))
;; (model (position #:vec3)
;; (matrix #:mat4)
;; (clip-space (* (camera matrix) (model matrix) (model position)))))
(define record-types '())
@Aeva
Aeva / patterns.scm
Created May 29, 2017 17:49
a simple partial type solving mechanism
(use-modules (srfi srfi-1))
(define (limit matcher list)
(define matched '())
(for-each
(lambda (item) (if (matcher item) (set! matched (cons item matched))))
list)
matched)
@Aeva
Aeva / drains.scm
Created May 29, 2017 17:49
A type inference system based on the Constraint Solver from SICP
(use-modules (srfi srfi-1))
(load "patterns.scm")
(define all-drains '())
(define (register-drain! drain)
(set! all-drains (cons drain all-drains))
drain)
(define (solved?)
(every (lambda (drain) (not (null? (drain 'type)))) all-drains))
@Aeva
Aeva / smol-layouts.org
Created June 24, 2017 17:47
keyboard layout mood board
@Aeva
Aeva / keyboard_matrix.cpp
Created July 3, 2017 21:36
simple keyboard matrix
// Pinout assumes Arduino Micro
int verticals[] = { 6, 5, 4, 3, 2 };
int horizontals[] = { 12, 11, 10, 9, 8 };
// State tracker for keyboard events
bool state[5][5];
// Define which pin sets are used for what when scanning.
#define drains verticals
#define inputs horizontals
@Aeva
Aeva / rendering.py
Created October 14, 2017 23:52
python rendering API mockup
# "DataSource" classes are used to define assorted properties and
# functions that might be used by a shader. The properties etc are
# not specific to any particular shader stage. So, "vertex"
# properties will have an implied varrying variable if they're
# accessed from the fragment shader.
class BasicModel(DataSource):
position = vertex.float4(index=0)
normal = vertex.float3()
uv = vertex.float2()
@Aeva
Aeva / roland_midi_events.txt
Created October 2, 2018 03:28
MIDI events from a Roland ep7ii
1: 10110000 ( 0xb0 ) status : Control Change, Channel: 0
2: 01111100 ( 0x7c ) data : 124
3: 00000000 ( 0x0 ) data : 0
4: 01111111 ( 0x7f ) data : 127
5: 00000000 ( 0x0 ) data : 0
6: 11111110 ( 0xfe ) event : Active Sense
7: 11111110 ( 0xfe ) event : Active Sense
8: 11111110 ( 0xfe ) event : Active Sense
9: 11111110 ( 0xfe ) event : Active Sense
10: 11111110 ( 0xfe ) event : Active Sense
@Aeva
Aeva / roland_midi_events2.txt
Created October 2, 2018 03:48
more MIDI events from a Roland ep7ii
38: 11111110 ( 0xfe ) event : Active Sense
39: 11111110 ( 0xfe ) event : Active Sense
40: 11000000 ( 0xc0 ) status : Program Change, Channel: 0
41: 00000001 ( 0x1 ) data : 1
42: 11111110 ( 0xfe ) event : Active Sense
43: 11111110 ( 0xfe ) event : Active Sense
44: 11111110 ( 0xfe ) event : Active Sense
45: 11111110 ( 0xfe ) event : Active Sense
46: 11111110 ( 0xfe ) event : Active Sense
47: 11111110 ( 0xfe ) event : Active Sense
@Aeva
Aeva / setup.sh
Last active September 13, 2019 05:45
calling cl.exe from within wsl
echo 'call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat">NUL' > /mnt/c/Users/aeva/cl.bat
echo '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\bin\Hostx64\x64\cl.exe" %*' >> /mnt/c/Users/aeva/cl.bat
alias cl="cmd.exe /q /c C:/Users/aeva/cl.bat"
@Aeva
Aeva / ray_marching_comparison.txt
Created December 4, 2019 06:19
ray marching comparison
--------------------------------------------------------------------------------
CASE 1: OLD
samples: 2
ray hit:
(tx: 1.2360679774997898, sd: -2.220446049250313e-16)
error: 0.0
--------------------------------------------------------------------------------