Skip to content

Instantly share code, notes, and snippets.

@MayowaObisesan
MayowaObisesan / demo.js
Last active August 7, 2024 08:01
This is a demo to show what github gist is all about.
function demo() {
console.log("This is a demo function in javascript");
return;
}
@faytey
faytey / commitmentscheme.rs
Created May 16, 2024 19:05
commitment scheme
use std::{error::Error, hash::{DefaultHasher, Hash, Hasher}};
trait Auction {
fn commit(a: u8, b: u8) -> Result<Vec<u8>, Box<dyn Error>>;
fn open(input: u8, commitment: Vec<u8>) -> Result<bool, Box<dyn Error>>;
}
struct Auctioning {}
impl Auctioning {
fn to_hash(value: u8) -> Vec<u8> {
@MayowaObisesan
MayowaObisesan / account_details.ts
Last active August 10, 2023 19:26
This script queries your ethereum account balance, transaction count and blockNumber on the ethereum mainnet, sepolia testnet and goerli testnet
// Mayowa Obisesan
// A script that queries an ethereum account balance, transaction count and blockNumber on ethereum's mainnet,
// sepolia and goerli testnet
import { ethers } from 'ethers';
const address: string = "0x298AAA9A0822eB8117F9ea24D28c897E83415440";
const accountDetails = async (networkType: string) => {
const provider = ethers.getDefaultProvider(networkType);
@ibrahimhajjaj
ibrahimhajjaj / currencies-with-flags.json
Last active May 6, 2026 12:43
Currencies json that contains currency flag as image data, currency codes, currency name, currency base country name, currency base country code.
[
{
"code": "AED",
"name": "UAE Dirham",
"country": "United Arab Emirates",
"countryCode": "AE",
"flag": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAG5SURBVHja7JdLihRBEEBfVqUU6rQNggiCFxA8gswFRNy49gAeQdx4G8HbuHDvRkRUnKxPZ2dGhous6Y9TtavPZmITtYggXsWPSKOqrCkFK8stgAFKoOr1kiKAt8CD76/f/KYYj//u7bPpU28Mn199eGiBLabg7uWLUePLp08mB/j66xvA1gKVSkK9J/29guuxNCZrVX60905qZlD0xvd5XbPvmN22uo+XCFDZXI2Idjt0txuk9TFM+ve7Yk9MAkAPIKSuI3XdoEMX/aQAd4qSfYpHAI0RbVt0FGA/KYAtyvMMaBTUObRpBh2a0E3cgspewkkJQkDqGm3bQfNPL9/PtIQ+cmjC5OqbTaj9qppRcglCAFej3h9H8P9xnBUgCtRNBllYDj0QmxbWAkgxggiktFjg60PosAeMJnQtAIkRq7poBlIfK5cgRBQdzYC1dtLgVVVRluUJgEQo7XH0RminlBDCKUDK99AIwByXs4gcb0JJafaFc7aCjTlktQBIqpiVAPIYas5AcXEx6LCRzaxjKAn4465GjZ1zs13GBngMPAceLbyFfwJfTP8m2PR6SfGAM7eP07UB/g0Aw73uXdMbeJMAAAAASUVORK5CYII="
},
{
"code": "AFN",
@iamnewton
iamnewton / bash-colors.md
Last active April 6, 2026 07:02
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple