Skip to content

Instantly share code, notes, and snippets.

@o-az
o-az / css.css
Last active April 21, 2024 05:45
A collection of useful CSS styles
blockquote::before {
content: open-quote;
}
blockquote::after {
content: close-quote;
}
.element {
z-index: calc(infinity);
@o-az
o-az / swagger-ui.html
Last active March 25, 2024 16:46
barebone index.html to use for swagger ui. Assumes you have a swagger.json file ready
<!doctype html>
<html lang='en'>
<head>
<meta charset='UTF-8' />
<title>_TITLE_</title>
<link rel='stylesheet' type='text/css' href='https://unpkg.com/swagger-ui-dist/swagger-ui.css' />
<style>
*,
*:before,

Keybase proof

I hereby claim:

  • I am o-az on github.
  • I am lovenough (https://keybase.io/lovenough) on keybase.
  • I have a public key ASArW03B41wuT8Ypk6BWjYdtS-iTotgede4lNHWjJShb_go

To claim this, I am signing this object:

@o-az
o-az / crypto_APIs.txt
Created August 4, 2021 19:09
A list of useful crypto APIs
--Coingecko
https://api.coingecko.com/api/v3/simple/price?ids=binancecoin&vs_currencies=usd&include_last_updated_at=true
--BinanceDEX
https://dex.binance.org/api/v1/tokens?limit=1000
--Apeboard
https://api.apeboard.finance/wallet/<chain>/<address>
https://storage.apeboard.finance/rates.json
https://api.apeboard.finance/airdropTerra/<address>
@o-az
o-az / union-demo.ts
Last active February 23, 2024 07:44
import { raise } from '#/utilities'
import { unionActions } from '#/actions.ts'
import { mnemonicToAccount } from 'viem/accounts'
import { http, publicActions, createWalletClient } from 'viem'
import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing'
import { UCS01_EVM_ADDRESS, demoMnemonic, chain } from '#/constants'
main().catch(_ => {
console.error(_)
process.exit(1)
@o-az
o-az / @cosmjs+amino+0.31.3.patch
Created February 22, 2024 08:28
cosmjs patch in order to support bn254 key type
diff --git a/node_modules/@cosmjs/amino/build/pubkeys.js b/node_modules/@cosmjs/amino/build/pubkeys.js
index e9844ef..86101f8 100644
--- a/node_modules/@cosmjs/amino/build/pubkeys.js
+++ b/node_modules/@cosmjs/amino/build/pubkeys.js
@@ -9,6 +9,10 @@ function isSecp256k1Pubkey(pubkey) {
return pubkey.type === "tendermint/PubKeySecp256k1";
}
exports.isSecp256k1Pubkey = isSecp256k1Pubkey;
+function isBn254Pubkey(pubkey) {
+ return pubkey.type === "tendermint/PubKeyBn254";
@o-az
o-az / buildNpmPackage.md
Last active February 7, 2024 06:13
All possible fields

Based on the Nix expression from https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/node/build-npm-package/default.nix, the buildNpmPackage function takes the following fields as inputs:

  • name: The name of the package. It defaults to a combination of pname and version from args.
  • src: The source of the package if it's a single source. Defaults to null.
  • srcs: The sources of the package if there are multiple. Defaults to null.
  • sourceRoot: The root directory of the source. Defaults to null.
  • prePatch: Commands to run before applying patches. Defaults to an empty string.
  • patches: A list of patches to be applied to the source. Defaults to an empty list.
  • postPatch: Commands to run after applying patches. Defaults to an empty string.
  • nativeBuildInputs: A list of native build dependencies. Defaults to an empty list.
@o-az
o-az / wagmi-actions.ts
Created January 9, 2024 03:31
wagmi cli action plugin codegen
import {
createReadContract,
createWriteContract,
createSimulateContract,
createWatchContractEvent,
} from 'wagmi/codegen'
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// EFPAccountMetadata
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* hide scrollbar */
*::-webkit-scrollbar {
height: 0.3rem;
width: 0rem;
}
*::-webkit-scrollbar-track {
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
@o-az
o-az / wrangler.json
Last active November 27, 2023 13:28
Cloudflare Workers wrangler JSON schema (might not be complete)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the project"
},
"main": {
"type": "string",