Skip to content

Instantly share code, notes, and snippets.

View laheadle's full-sized avatar

Lyn Headley laheadle

View GitHub Profile
@laheadle
laheadle / gist:a6b5f4c6df3218a586a9a043c1de18aa
Created March 27, 2024 20:21
Using stripe api via clojure interop in a biff app
(ns org.stinkless.rekonstruction.api.entry
(:require
[cheshire.core :as cheshire]
[com.biffweb :as biff]
[org.stinkless.rekonstruction.raw.anomalies :as an]
[org.stinkless.rekonstruction.util :as util]
[taoensso.truss :as truss])
(:import
(com.stripe.model.checkout Session)
(com.stripe.param.checkout SessionCreateParams SessionCreateParams$LineItem SessionCreateParams$LineItem$PriceData SessionCreateParams$LineItem$PriceData$ProductData SessionCreateParams$Mode)))
{:deps {cider/cider-nrepl {:mvn/version "0.28.3"}
refactor-nrepl/refactor-nrepl {:mvn/version "3.6.0"}}}
@laheadle
laheadle / machine.js
Last active May 21, 2020 20:07
Generated by XState Viz: https://xstate.js.org/viz
const m = Machine({
"id": "highlight",
"type": "parallel",
"states": {
"HLAttachment": {
"id": "HLAttachment",
"initial": "unattached",
"states": {
"unattached": {
"id": "unattached",
@laheadle
laheadle / machine.js
Last active May 14, 2020 16:59
Generated by XState Viz: https://xstate.js.org/viz
const m = Machine({"id":"slides","initial":"showSlideOneHideSlideTwo","states":{"showSlideOneHideSlideTwo":{"on":{"CLICK_LINKONE":{"target":"showingSlideTwo","actions":["setCurrentSlide","ariaHideSlideOne","ariaShowSlideTwo","lowerSlideOne","raiseSlideTwo"]}}},"showingSlideTwo":{"after":{"300":"quickHideSlideOne"},"entry":["settingSlideTwoOpacity","settingSlideTwoVisibility"]},"quickHideSlideOne":{"initial":"turningOffTransitions","states":{"turningOffTransitions":{"after":{"10":"hidingSlideOne"}},"hidingSlideOne":{"entry":["zeroSlideOneOpacity","hideSlideOneVisibility"],"after":{"10":{"target":"turningOnTransitions"}}},"turningOnTransitions":{"after":{"10":"#slides.hideSlideOneShowSlideTwo"}}}},"hideSlideOneShowSlideTwo":{}}})
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
const contentMachine = Machine({
id: 'content',
initial: 'empty',
context: {
},
states: {
empty: {
on: {
configure: 'configured'
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@laheadle
laheadle / SketchSystems.spec
Last active June 16, 2018 13:02
Generic Request
Generic Request
Logged In
logout -> Not Logged In
any request -> Logged In
Not Logged In
any request -> Choose Identity Provider
Choose Identity Provider
click oauth provider -> Await Return
Await Return
auth response -> Validate Auth
Creator
Dialogging
create new dialog -> Creating Invitation
Creating Invitation
start typing -> Typing
Typing
submit -> Awaiting Response
Awaiting Response
response-link-clicked -> Responder
Responder
function makeRecvPacket()
buf, len = nextPacketBuf()
if buf == nil then
return false
end
log("received")
if len ~= maxpacketlen then
log("packet len "..tostring(len))
end
packet = {}