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);

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 / @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 / 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 / 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 / _ansi-color-codes.md
Last active November 26, 2023 01:41
ANSI color codes in various file formats (.sh, .json, .ts)
ansi colors demo
@o-az
o-az / reset-to-initial-commit.sh
Created November 16, 2023 00:06
Reset the current branch to the initial commit, keeping the working directory as it is
git reset --soft `git rev-list --max-parents=0 HEAD`
@o-az
o-az / hide-scrollbar.js
Created November 2, 2023 11:54
Hide ugly default browser scrollbar without affecting functionality
// ==UserScript==
// @name Hide Scrollbar
// @namespace http://example.com
// @version 1
// @grant GM_addStyle
// @include https://twitter.com/*
// @include https://x.com/*
// @include https://warpcast.com/*
// ==/UserScript==