Skip to content

Instantly share code, notes, and snippets.

View tobySolutions's full-sized avatar
:octocat:
Building Software

Tobiloba Adedeji tobySolutions

:octocat:
Building Software
View GitHub Profile
@tobySolutions
tobySolutions / ens-lookup.js
Last active September 2, 2024 08:47
ENS-lookup function
import Web3 from "web3";
export const main = async ({ path = "vitalik.eth" }) => {
const ensDomain = path.split("/").pop();
// Check if the path is a valid string
if (typeof ensDomain !== "string" || !ensDomain.endsWith(".eth")) {
throw new Error("Invalid ENS domain");
}
import { ethers } from "ethers";
import { JsonRpcProvider } from "ethers";
BigInt.prototype.toJSON = function () {
return this.toString();
};
export async function main(ensDomain = "vitalik.eth") {
// const ensDomain = "vitalik.eth";
@tobySolutions
tobySolutions / .tsx
Last active December 16, 2023 16:46
Context stuff
import { createContext, useContext, ReactNode, useState } from 'react';
// Define the type for user information
interface User {
id: number;
username: string;
}
// Define the type for the context
interface AppContextProps {
@tobySolutions
tobySolutions / time_excercise.md
Created November 24, 2022 21:45 — forked from nonsocode/time_excercise.md
Time complexity

Q1.

def f():
	int a[N + 1][M + 1][K + 1]
	sum = 0
	for i = 1 to N:
		for j = i to M:
			for k = j to K:
				sum += a[i][j]
	print(sum)