Skip to content

Instantly share code, notes, and snippets.

View arilotter's full-sized avatar

Ari Lotter arilotter

View GitHub Profile
@arilotter
arilotter / App.tsx
Created September 28, 2022 16:36
Sequence Rainbowkit Connector
import {
ConnectButton,
connectorsForWallets,
RainbowKitProvider,
wallet,
} from '@rainbow-me/rainbowkit';
import { WagmiConfig } from 'wagmi';
import { chain, configureChains, createClient } from 'wagmi';
import { alchemyProvider } from 'wagmi/providers/alchemy';
import "@rainbow-me/rainbowkit/styles.css";
@arilotter
arilotter / sequence-connector.ts
Created August 18, 2022 18:35
sequence connector (not fully implemented)
import { sequence } from '0xsequence'
import { mainnetNetworks, testnetNetworks } from '@0xsequence/network'
import type { ConnectOptions, ProviderConfig, Web3Provider } from '@0xsequence/provider'
import { Wallet } from '@0xsequence/provider'
import { Chain } from '@rainbow-me/rainbowkit'
import { Connector, ConnectorData, ConnectorNotFoundError, UserRejectedRequestError } from 'wagmi'
interface Options {
provider?: Partial<ProviderConfig>
connect?: ConnectOptions
@arilotter
arilotter / AssetHashManifest.ts
Created March 8, 2022 22:10
How Skyweaver's asset manifests are parsed! :)
export interface AssetsManifestTree {
radix: number
dicts: {
dirs: string[]
exts: string[]
segments: string[]
filenames: string[]
}
encoded: { [dirext: string]: { [filename: string]: string } }
}
@arilotter
arilotter / home.nix
Created September 17, 2021 15:05
Replay NixOS derivation
home.packages = [
(self.callPackage ./replay { };)
]
@arilotter
arilotter / fetch.js
Last active September 13, 2021 16:17
const cardsEndpoint = 'https://api.skyweaver.net/rpc/SkyWeaverAPI/GetCardLibrary';
async function getCards() {
const cardResults = await fetch(cardsEndpoint, {
method: 'post',
body: JSON.stringify({
page: {
page: 1,
pageSize: 1000
}
@arilotter
arilotter / dupl
Last active April 27, 2020 20:26
{"secrets":[{"cards":{"dataType":"Map","value":[[4,{"id":4,"view":{"cost":2,"prism":"agy","element":"earth","power":0,"health":0,"keywords":[],"type":"Spell","canBePlayed":true,"isSilenced":false,"markedForDeath":true,"canAttack":false,"isSleeping":true,"canBeTargetedByOwner":true,"canBeTargetedByEnemy":true,"isStealthed":false,"canAttackHeroPastGuard":false},"base":"981","temporaryModifiers":[],"instance":{"cost":2,"prism":"agy","element":"earth","power":0,"health":0,"keywords":[],"type":"Spell","canBePlayed":true,"isSilenced":false,"markedForDeath":true,"canAttack":true,"isSleeping":true,"canBeTargetedByOwner":true,"canBeTargetedByEnemy":true,"isStealthed":false,"canAttackHeroPastGuard":false}}],[5,{"id":5,"view":{"cost":3,"prism":"agy","element":"air","power":4,"health":2,"keywords":["Banner"],"type":"Unit","canBePlayed":true,"isSilenced":false,"markedForDeath":false,"canAttack":false,"isSleeping":true,"canBeTargetedByOwner":true,"canBeTargetedByEnemy":true,"isStealthed":false,"canAttackHeroPastGuard":fals
@arilotter
arilotter / playground.rs
Created October 10, 2019 21:12 — forked from rust-play/playground.rs
Code shared from the Rust Playground
struct C120;
enum Zone {
Graveyard
}
struct MoveToZone {
to: Zone,
from: Zone
}
"dependencies": {
"animejs": "^2.2.0",
"core-js": "^2.5.5",
"framesync": "^3.1.9",
"layout-bmfont-text": "^1.3.4",
"lodash": "^4.17.5",
"node-fetch": "^2.2.0",
"popmotion": "^8.3.7",
"quad-indices": "^2.0.1",
"query-string": "^6.1.0",
const UPDATE_SIGNAL = {}
const emptyObject = {}
function defaultApplyProps(instance, _oldProps, newProps) {
// impl etc
}
function applyProps(instance, oldProps, newProps) {
if (typeof instance._customApplyProps === "function") {
instance._customApplyProps(instance, oldProps, newProps)
} else {
defaultApplyProps(instance, oldProps, newProps)
@arilotter
arilotter / README.md
Created July 11, 2018 14:09
create-react-app backend example

A backend with create-react-app

Modify your folder structure so you have something like

your_project
  | frontend ( your create-react-app project )
  | backend ( your backend (express?) project )

In the your_project folder, do an npm init. Then, $ npm i concurrently so you can run your backend and the react dev server... concurrently. Modify the package.json in your_project to have something like this: