- Commands vs Events
- Complex Addition
Something that CAN happen.
IT'S A COMMAND
#!/usr/bin/env node | |
const fcl = require("@onflow/fcl") | |
console.log("hello") | |
fcl.account(process.argv[3]).then(fcl.decode).then(d => console.log(d)) |
{ | |
"name": "lolololololol", | |
"version": "999.99.99", | |
"bin": "./rawr.js", | |
"dependencies": { | |
"@onflow/fcl": "0.0.67-alpha.43" | |
} | |
} |
/** | |
* Creates a pseudo-random value generator. The seed must be an integer. | |
* | |
* Uses an optimized version of the Park-Miller PRNG. | |
* http://www.firstpr.com.au/dsp/rand31/ | |
*/ | |
function Random(seed) { | |
this._seed = seed % 2147483647; | |
if (this._seed <= 0) this._seed += 2147483646; | |
} |
// PTS | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
// ----+---------------------------------------------------- | |
// R1 | t6 t12 t4 t8 t5 t14 t11 t10 t13 t1 t2 t9 t3 t7 | |
// R2 | t6 t4 t14 t13 t11 t10 t12 t1 t8 t5 t2 t9 t3 t7 | |
// R3 | t6 t5 t11 t4 t14 t8 t10 t2 t1 t13 t12 t9 t3 t7 | |
// R4 | t6 t5 t4 t10 t12 t11 t13 t8 t14 t2 t1 t9 t3 t7 | |
// R5 | t6 t13 t11 t2 t10 t5 t12 t14 t8 t1 t4 t9 t3 t7 | |
// R6 | t6 t5 t4 t13 t12 t8 t14 t11 t10 t1 t2 t9 t3 t7 | |
// R7 | t6 t5 t13 t8 t4 t10 t1 t2 t14 t11 t12 t3 t9 t7 | |
// R8 | t6 t5 t11 t14 t8 t4 t13 t10 t12 t1 t2 t3 t9 t7 |
const root = | |
(typeof self === 'object' && self.self === self && self) || | |
(typeof global === 'object' && global.global === global && global) || | |
(typeof window === 'object' && window.window === window && window) || | |
this | |
root.__RAWR__ = { | |
onMount: (domNode, props) => { | |
// ReactDOM.render(<Counter {...props} />, domNode) | |
domNode.innerHTML = `<div> |
const { GenServer, Ok, Reply, NoReply, Continue } = require("./gen-server") | |
var counts = {} | |
function UpdateCount(event) { | |
if (!(this instanceof UpdateCount)) return new UpdateCount(event) | |
this.count = event.count | |
} | |
const Counter = GenServer({ |
I hereby claim:
To claim this, I am signing this object:
defmodule BankAccount do | |
def start do | |
await | |
end | |
def await, do: await([]) | |
def await events do | |
receive do | |
event = { :deposit, _amount } -> events = [ event | events ] | |
event = { :withdraw, _amount } -> events = [ event | events ] |
const foo1 = () => { this.rawr = "rawr" } | |
function foo2 () { this.rawr = "rawr" } | |
function moo2 () { this.rawr = "moo" } | |
function resetRawr () { this.rawr = "rawr" } | |
function setRawr (value) { this.rawr = value } | |
const rawrStuff = { moo2: moo2, resetRawr: resetRawr, setRawr: setRawr } | |
foo1() |