Skip to content

Instantly share code, notes, and snippets.

View perfect-cents's full-sized avatar

Braden Pezeshki perfect-cents

View GitHub Profile
@perfect-cents
perfect-cents / app.js
Last active November 30, 2021 21:52
Add Login with Unstoppable in under 5 minutes
import UAuth from '@uauth/js'
const uauth = new UAuth({
clientID: 'uauth_example_spa_id',
clientSecret: 'uauth_example_spa_secret',
redirectUri: 'http://localhost:5000/callback',
})
window.login = async () => {
try {
@perfect-cents
perfect-cents / example.js
Created January 3, 2019 22:24
Simple middleware pattern in javascript
const m = new AsyncMiddleware()
m.use((ctx, nxt) => {
ctx.val = 1
return next()
})
m.use(ctx => ctx.val)
@perfect-cents
perfect-cents / browseth-framework-playground.ts
Created May 20, 2018 19:46
A couple ideas about a potential browseth framework
// chainId, nonce, from
// should be determined in the send and call functions respectivly
interface ToStringable {
toString(): string;
}
type Data = string | ToStringable;
type Quantity = number | string | ToStringable;
type Block = Quantity;
@perfect-cents
perfect-cents / redux-saga.html
Created December 20, 2017 22:44
An example ping Redux-Saga demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Redux Saga Demo</title>
</head>
<body>
<noscript>