Skip to content

Instantly share code, notes, and snippets.

View shirotech's full-sized avatar

Van Nguyen shirotech

View GitHub Profile
@shirotech
shirotech / contractActions.ts
Last active August 11, 2024 18:49
This function is used to extend any `viem` client that will add a `getContract` function, and supports calling `read`, `write`, `simulate` with `inputs` and `outputs` objects mapping contract ABI rather than tuples.
import type { AbiParameterKind, ExtractAbiFunction } from "abitype";
import type {
Abi,
AbiParameterToPrimitiveType,
Account,
Address,
Chain,
Client,
ContractFunctionArgs,
ContractFunctionName,
@shirotech
shirotech / bootstrap-responsive-headers.less
Last active August 29, 2015 14:25
Bootstrap responsive headers (h1, h2, h3, h4, h5, h6)
body {
.headers(@i, @diff) when (@i > 0) {
h@{i} {
@font-size: "font-size-h@{i}";
font-size: @@font-size - @diff;
}
.headers(@i - 1, @diff);
}
@shirotech
shirotech / gist:c5b278271a768531eeb3
Last active October 22, 2020 05:24
Cycle2 CSS transition plugin
(function($) {
var style = document.createElement('div').style,
tx = $.fn.cycle.transitions,
supported = style.transform !== undefined ||
style.MozTransform !== undefined ||
style.webkitTransform !== undefined ||
style.oTransform !== undefined ||
style.msTransform !== undefined;
if ( supported ) {