I hereby claim:
- I am josefrichter on github.
- I am josefrichter (https://keybase.io/josefrichter) on keybase.
- I have a public key ASAYoMYvFMXARyy3y1bGYvjWElSi1FoiDldsDpYkMy0R4Qo
To claim this, I am signing this object:
ref: refs/heads/main |
const data = Data({ | |
ch1page: 1, | |
ch2page: 1, | |
ch3page: 1, | |
}) | |
const ch1times = [1000, 1100, 1200, 1300] | |
const ch2times = [1000, 1015, 1100, 1130] | |
const ch3times = [1000, 1015, 1030, 1130] |
I hereby claim:
To claim this, I am signing this object:
(defmodule nova-rest.controllers.pet | |
(export | |
(manage 1))) | |
(defun manage | |
;; | |
;; GET Handler (Index) | |
;; | |
([(map 'req (map 'method #"GET"))] |
import * as React from "react"; | |
import { useState, useEffect } from "react"; | |
/** | |
A hook to simply use state between components | |
Usage: | |
// You can put this in an central file and import it too | |
const useStore = createStore({ count: 0 }) |
defmodule QueueAgent do | |
def start_link(queue, name) do | |
Agent.start_link(fn -> queue end, name: name) | |
end | |
def add(queue, item) do | |
Agent.cast(queue, fn(state) -> state ++ [item] end) | |
end | |
def get(queue) do |
defmodule Queue do | |
use GenServer | |
def start_link(queue, name) do | |
GenServer.start(__MODULE__, queue, name: name) | |
end | |
# GenServer callbacks | |
def handle_call(:get, _from, [item | queue]) do |
defmodule Tester do | |
def start_run do | |
Agent.start(fn -> [total: 0, passed: 0, failed: 0] end, name: :test_stats) | |
end | |
def record_pass do | |
Agent.update(:test_stats, fn [total: t, passed: p, failed: f] -> | |
[total: t + 1, passed: p + 1, failed: f] | |
end) | |
end |
defmodule KV.Registry do | |
use GenServer | |
## Missing Client API - will add this later | |
## Defining GenServer Callbacks | |
@impl true | |
def init(:ok) do | |
{:ok, %{}} |
defmodule Stack do | |
use GenServer | |
# Client | |
def start_link(default) when is_list(default) do | |
GenServer.start_link(__MODULE__, default) | |
end | |
def push(pid, element) do |