Skip to content

Instantly share code, notes, and snippets.

View bshepherdson's full-sized avatar

Braden Shepherdson bshepherdson

  • Metabase
  • Godfrey, ON, Canada
View GitHub Profile
@bshepherdson
bshepherdson / repro.clj
Created May 2, 2024 02:51
Repro of my issues with Pathom 3 nested data structures
(ns repro
(:require
[clojure.test :refer [deftest is testing]]
[com.wsscode.pathom3.connect.built-in.resolvers :as pbir]
[com.wsscode.pathom3.connect.indexes :as pci]
[com.wsscode.pathom3.connect.operation :as pco]
[com.wsscode.pathom3.interface.eql :as p.eql]))
(deftest more-input-more-problems
(let [map-data {123 {:data/name "Alice"}
@bshepherdson
bshepherdson / clue.md
Created June 13, 2020 18:04
Clue Drinking Game rules
  • Ominous thunder and lightning
  • Every gun shot
  • Every time the doorbell rings
  • Screaming (not just shouting)
  • Every death
  • “Communism is a red herring”
  • Each time Mr. Green gets slapped
  • Each time something is spoken in unison
  • "To make a long story short..." drink before it's "too late"
@bshepherdson
bshepherdson / README.md
Created August 29, 2018 17:19
Glimmer rendering stress test

Stress Test

I'm stress testing Glimmer by rendering a counter and a big table (current 100 wide and 300 tall) of cells holding just a 1.

I'd like the whole thing to render at a respectable pace, maybe a few seconds for such a large nested {{#each}}. And above all I want the increment button to feel responsive.

testAsync
| p |
self timeout: 100.
p := Promise new: [ :model | [ model value: 7 ] valueWithTimeout: 300 ].
p then: [ :x | self assert: x equals: 7. self finished ] catch: [ self signalFailure: 'Promise error' ].
@bshepherdson
bshepherdson / keyboard.md
Created November 28, 2016 15:40
Alternative keyboard spec for DCPU

Generic Keyboard

---=I NEED A LOGO=---
Item Value Comment
Vendor code 0x1c6c8b36 NYA Elektriska
use "net"
primitive _PayloadStart
primitive _PayloadHeaders
primitive _PayloadContentLength
primitive _PayloadChunkStart
primitive _PayloadChunk
primitive _PayloadChunkEnd
primitive _PayloadBody
primitive _PayloadReady
@bshepherdson
bshepherdson / error.pony
Created May 25, 2016 14:50
Internal error not reported when Pony object literal has undefined internal fields
actor Main
new create(env: Env) =>
var o = bar()
var s: String val = recover val
var t: String ref = String()
t.concat(consume o)
t
end
env.out.print(s)
@bshepherdson
bshepherdson / json.pony
Created May 18, 2016 17:56
Pony streaming JSON API
use "collections"
type JsonValue is (String | I32 | F64 | None)
primitive JsonTokenStartArray
primitive JsonTokenEndArray
primitive JsonTokenStartObject
primitive JsonTokenEndObject
primitive JsonTokenFieldName
primitive JsonTokenNull
class Foo[A: Any #read]
let _value: A
new create(v: A) => _value = v
fun foo(): A => _value
#0 0x000a7150 in ast_id (ast=0x67a17080) at src/libponyc/ast/ast.c:416
#1 0x000e3a68 in is_sub_cap_and_eph (sub=0x63825f40, super=0x67a230c0, errors=0x0) at src/libponyc/type/subtype.c:79
#2 0x000e5f6c in is_typeparam_sub_typeparam (sub=0x63825f40, super=0x67a230c0, errors=0x0) at src/libponyc/type/subtype.c:1066
#3 0x000e6178 in is_typeparam_base_sub_x (sub=0x63825f40, super=0x67a230c0, errors=0x0) at src/libponyc/type/subtype.c:1135
#4 0x000e61ec in is_typeparam_sub_x (sub=0x63825f40, super=0x67a230c0, errors=0x0) at src/libponyc/type/subtype.c:1149
#5 0x000e69c4 in is_subtype (sub=0x63825f40, super=0x67a230c0, errors=0x0) at src/libponyc/type/subtype.c:1401
#6 0x000e4fe0 in is_tuple_sub_tuple (sub=0x6380c560, super=0x67a1d1a0, errors=0x0) at src/libponyc/type/subtype.c:620
#7 0x000e5200 in is_tuple_sub_x (sub=0x6380c560, super=0x67a1d1a0, errors=0x0) at src/libponyc/type/subtype.c:671
#8 0x000e6994 in is_subtype (sub=0x6380c560, super=0x67a1d1a0, errors=0x0) at src/libponyc/type/subtype.c:1395
#9