Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Ramage ryanramage

  • Edmonton, AB, Canada
View GitHub Profile
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View niff.js
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 / scale.js
Created Sep 29, 2017
Make a scaling function that maps from one range to another
View scale.js
const scale = (inMin, inMax, outMin, outMax) => (input) => outMin + ((outMax - outMin) * ((input - inMin) / (inMax - inMin)))
View 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 / readme.md
Last active Feb 9, 2017
twilio things
View readme.md

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 / form.js
Created Jul 14, 2016
Slackbot form for multi-user
View form.js
#!/usr/bin/env node
const isPhone = require('is-phone')
const RtmClient = require('@slack/client').RtmClient
const MemoryDataStore = require('@slack/client').MemoryDataStore
const RTM_EVENTS = require('@slack/client').RTM_EVENTS
const token = process.env.SLACK_TOKEN || ''
const rtm = new RtmClient(token, {
logLevel: 'error',
View response.json
{
"took": 9,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 9063,
@ryanramage
ryanramage / package.json
Last active Aug 29, 2015
Example package.json using docker build run push
View package.json
{
"name": "example",
"version": "2.1.4",
"description": "Example docker",
"scripts": {
"start": "node bin/cli",
"docker-build": "rm -rf node_modules && npm i --production && ./node_modules/docker-build-run-push/docker-build",
"docker-run": "./node_modules/docker-build-run-push/docker-run",
"docker-push": "rm -rf node_modules && npm i && make build && npm prune && ./node_modules/docker-build-run-push/docker-push"
},
@ryanramage
ryanramage / Dockerfile
Last active Aug 29, 2015
Example Dockerfile
View Dockerfile
FROM ryanramage/pm2-git-alpine
# Add source files & deps
ADD . /var/www/ui-widgets
WORKDIR /var/www/ui-widgets
# Define mountable directories.
VOLUME ["/var/log/ui-widgets"]
@ryanramage
ryanramage / log.txt
Last active Aug 29, 2015
rcouch build
View log.txt
> git clone https://github.com/apache/couchdb.git
> cd couchdb/
> git checkout -b 1994-merge-rcouch origin/1994-merge-rcouch
> make
> make check
---skipping logs, to around the failures -----
oauth_users_db.js ... testing
oauth_users_db.js ... ok
You can’t perform that action at this time.