Skip to content

Instantly share code, notes, and snippets.

@lynaghk
lynaghk / 0-update.md
Last active July 5, 2022 13:33
Angular.js from ClojureScript
@lynaghk
lynaghk / SketchSystems.spec
Last active March 20, 2022 20:19
SketchSystems Frontend App*
SketchSystems Frontend App*
# Fired whenever the URL changes (e.g., browser's back/forward buttons are used, or if someone clicks a link in the UI to navigate to their profile, create a new sketch, etc.)
navigate -> Loading
Error
# All events from this state come from the server, which tells the frontend whether the user is logged in, if they own this sketch, etc.
Loading*
new logged in -> New Logged In
@lynaghk
lynaghk / sketch systems grammar.md
Last active March 20, 2022 20:11
Sketch.systems grammar

Sketch.systems uses the wonderful Instaparse Clojure(Script) library to parse statechart specifications. Unfortunately, the current grammar is quite memory intensive and on larger specs suffers from multi-second garbage collection pauses.

Suggestions welcome!

@lynaghk
lynaghk / user.clj
Created March 18, 2022 21:21
Rel and Datascript comparison
;; A comparison of Rel: https://docs.relational.ai/rel/primer/aggregations_groupby_joins
;; with datascript: https://github.com/tonsky/datascript/
;; Unless otherwise indicated, all datascript outputs match the ones shown in the Rel Primer.
(ns user
(:require [datascript.core :as d]
clojure.string))
(def csv
"Messi,70,32,BFC,Argentina
id val
C4410 1000
C17985 750
C17887 300
C17900 100000
C17901 100
C17902 10000
C17903 10
C17924 180
C17928 1
@lynaghk
lynaghk / jlcpcb_xls2csv.py
Created February 6, 2021 07:37
Download JLCPCB part library as a spreadsheet (https://jlcpcb.com/parts) then turn it into a sqlite database so you can search/view/sort parts using https://sqlitebrowser.org/
#!/usr/bin/env python
import xlrd
import os
import sys
import csv
import re
re_px = re.compile(":([0-9.]+)")
@lynaghk
lynaghk / Couch Back.jpg
Last active January 4, 2021 15:10
Image Upload Test
Couch Back.jpg
@lynaghk
lynaghk / SketchSystems.spec
Created July 2, 2018 12:24
LoadingAnimation
LoadingAnimation
Loading
next -> AlmostDone
AlmostDone
next -> Finished
Finished
next -> App
App
JSX example
@lynaghk
lynaghk / lib.rs
Created September 24, 2019 18:43
streaming realsense depth map video over network
pub mod network;
pub mod realsense_bindings;
pub type CameraTimestamp = u64;
pub const WIDTH: usize = 640;
pub const HEIGHT: usize = 480;
pub const FPS: usize = 30;
pub const FRAME_SIZE: usize = WIDTH * HEIGHT * 2; //16 bit depth info
pub const RECIEVER_ADDR: &'static str = "192.168.1.2:9898";