Skip to content

Instantly share code, notes, and snippets.

View ryanramage's full-sized avatar

Ryan Ramage ryanramage

View GitHub Profile
@ryanramage
ryanramage / readme.md
Last active February 9, 2017 18:18
twilio things

Tech things

  • No insight into websocket billing (reads, writes, etc) api is not clear on this
  • Hard to do initial sync with disposable channels. new api may help but we have not upgraded
  • 2 system sync has lots of fun timing issues. All the stuff that is not in twilio pchat, we need to sync to the local machine
        channel.sendMessage(message, {
          origin: 'internal',
 sender: sender
@ryanramage
ryanramage / keybase.md
Created July 12, 2017 05:27
keybase.md

Keybase proof

I hereby claim:

  • I am ryanramage on github.
  • I am ryanramage (https://keybase.io/ryanramage) on keybase.
  • I have a public key whose fingerprint is E2ED 94ED EB71 0CB3 BABE 72AD 554A 370A 6ED8 09EE

To claim this, I am signing this object:

@ryanramage
ryanramage / scale.js
Created September 29, 2017 14:49
Make a scaling function that maps from one range to another
const scale = (inMin, inMax, outMin, outMax) => (input) => outMin + ((outMax - outMin) * ((input - inMin) / (inMax - inMin)))
@ryanramage
ryanramage / niff.js
Created November 30, 2019 17:23
niff
library['_'] = function Operator_ (orca, x, y, passive) {
Operator.call(this, orca, x, y, '_', passive)
this.name = 'niff'
this.info = 'Reads offset, if equal to char'
this.ports.x = { x: -2, y: 0 }
this.ports.y = { x: -1, y: 0 }
this.ports.comparison = { x: 1, y: 0 }
this.ports.output = { x: 0, y: 1, bang: true }
@ryanramage
ryanramage / machine.js
Created August 10, 2020 17:36
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
import z from 'zod'
export const name = 'myFunction'
export const param = z.object({
a: z.string(),
b: z.number()
}).strict
export const returns = z.boolean()
export const MyFunctionSchema = z.function().args(param).returns(returns)
/** @typedef { z.infer<typeof MyFunctionSchema> } MyFunction */