Configure AWS console
aws configure sso
# Role: PowerUser
# Profile name: Enter 'default' to make this the default profile used for all AWS commands
/** | |
* If argument is a string, try to parse as JSON. | |
* Otherwise return null. | |
*/ | |
export function parseOrNull(raw: unknown) { | |
if (!raw) return null | |
if (typeof raw === 'string') { | |
try { | |
return JSON.parse(raw) |
import type { Reactive, Subscriber, Store } from './types' | |
export function Store<S>(initial: S): Store<S> { | |
let current = initial | |
const subscribers = new Set<Subscriber<S>>() | |
function subscribe(subscriber: Subscriber<S>) { | |
subscribers.add(subscriber) | |
return () => unsubscribe(subscriber as VoidFunction) | |
} |
export function ReactiveMap<K, V>(map: Map<K, V>): ReactiveMap<K, V> { | |
const subscribers = new Set<Subscriber<MapState<K, V>>>() | |
function notify() { | |
const state: MapState<K, V> = [Array.from(map.entries()), map] | |
subscribers.forEach(subscriber => subscriber(state)) | |
} | |
function unsubscribe(subscriber: Subscriber<MapState<K, V>>) { |
export function ComplexKeyedMap<K, V>( | |
formatter: StringFormatter<K>, | |
entries?: readonly (readonly [K, V])[] | null | |
): Map<K, V> { | |
const map = new Map<string, V>( | |
entries?.map(([k, v]) => [formatter.asString(k), v]) | |
) | |
function* getEntries() { |
function GoogleDocFrame({ url }: { url: string }) { | |
const frameRef = useRef<HTMLIFrameElement>(null) | |
const viewerUrl = `https://docs.google.com/viewer?embedded=true&url=${url}` | |
let cancel: () => void | undefined | |
useEffect(() => { | |
cancel = setFrameSrcWithRetry(frameRef.current!, viewerUrl, true) | |
// unmount | |
return () => { | |
if (cancel) { |
Verifying my Blockstack ID is secured with the address 1EbxrkJezeMR8LqeKVVBGoSfzA6MbrwfRh https://explorer.blockstack.org/address/1EbxrkJezeMR8LqeKVVBGoSfzA6MbrwfRh |
Verifying my Blockstack ID is secured with the address 1EbxrkJezeMR8LqeKVVBGoSfzA6MbrwfRh https://explorer.blockstack.org/address/1EbxrkJezeMR8LqeKVVBGoSfzA6MbrwfRh |
Verifying my Blockstack ID is secured with the address 1EbxrkJezeMR8LqeKVVBGoSfzA6MbrwfRh https://explorer.blockstack.org/address/1EbxrkJezeMR8LqeKVVBGoSfzA6MbrwfRh |
Verifying my Blockstack ID is secured with the address 1EbxrkJezeMR8LqeKVVBGoSfzA6MbrwfRh https://explorer.blockstack.org/address/1EbxrkJezeMR8LqeKVVBGoSfzA6MbrwfRh |