View mirrorxyz-indexer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Arweave from "arweave"; | |
type Post = { | |
authorship: { | |
contributor: string; | |
}; | |
content: { | |
body: string; | |
timestamp: string; | |
title: string; |
View ens-utils.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ens-utils.js | |
// import a couple data formatting libraries | |
const { default: BigNumber } = require('bignumber.js'); | |
const uts46 = require('idna-uts46-hx'); | |
// make sure to also impmort web3.js | |
const Web3 = require('web3'); | |
// configure BigNumber to not round large floats |
View eth-indexer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { Log, Transaction, TransactionReceipt } from 'web3-core'; | |
import type { BlockTransactionBase } from 'web3-eth'; | |
import knex from 'knex'; | |
import Web3 from 'web3'; | |
let web3 = null; | |
let web3Websocket = null; | |
const db = knex({ | |
client: 'pg', |
View locustfile-py2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from locust import HttpLocust, TaskSet, between | |
from random import randint | |
MAX_TIMEOUT = 10 | |
def cart_quote(l): | |
l.client.post('/app/api/cart/quote', | |
name='/cart/quote', |
View locustfile.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from locust import HttpLocust, TaskSet, between | |
from random import randint | |
MAX_TIMEOUT = 10 | |
def cart_quote(l): | |
l.client.post('/api/v1/cart/quote', | |
name='/cart/quote', |
View hasher.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import json | |
def hasher(content, root=True): | |
if isinstance(content, list): | |
content = list([hasher(x, False) for x in content]) | |
content.sort() | |
content = ''.join(content) | |
elif isinstance(content, dict): |
View hosting_setup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# setup ssh | |
cd ~ | |
mkdir -p ~/.ssh | |
chmod 600 ~/.ssh | |
curl https://github.com/brock-haugen.keys > ~/.ssh/authorized_keys | |
chmod 700 ~/.ssh/authorized_keys | |
# setup vim |