Skip to content

Instantly share code, notes, and snippets.

View Tee-py's full-sized avatar
🏠
Working from home

Oluwatobiloba Emmanuel Tee-py

🏠
Working from home
View GitHub Profile
@Tee-py
Tee-py / parser.ts
Created October 26, 2024 17:33
Anchor parser
import { clusterApiUrl, Connection, PartiallyDecodedInstruction, PublicKey } from "@solana/web3.js"
import { sha256 } from '@noble/hashes/sha256';
import { bs58 } from '@coral-xyz/anchor/dist/cjs/utils/bytes';
import * as borsh from "@coral-xyz/borsh";
import { BorshCoder, EventParser, Idl } from "@coral-xyz/anchor";
import { PumpFunIDL } from './idl';
const parseInstruction = async () => {
const signature = "4XQZckrFKjaLHM68kJH7dpSPo2TCfMkwjYhLdcNRu5QdJTjAEehsS5UMaZKDXADD46d8v4XnuyuvLV36rNRTKhn7";
const connection = new Connection(clusterApiUrl("mainnet-beta"));
@Tee-py
Tee-py / collage.rs
Created January 1, 2024 10:49
Create a collage of all the pictures in your computer
use std::{fs};
use std::ops::Div;
use image::{ImageBuffer, RgbImage, imageops, DynamicImage};
use std::path::PathBuf;
#[derive(Debug)]
enum FileType {
IMAGE,
VIDEO
}
@Tee-py
Tee-py / inec_scraper.py
Created November 5, 2022 10:36 — forked from prettyirrelevant/inec_scraper.py
Scrapes INEC's website to retrieve all polling units in the country.
import asyncio
import json
from typing import Any, Dict, List, Tuple
import aiohttp
from bs4 import BeautifulSoup
async def main() -> None:
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl=False)) as session:
@Tee-py
Tee-py / ballot.sol
Created March 6, 2022 11:12
Optimized Ballot Smart Contract using Mappings
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
// Optimized version of the ballot contract on solidity docs
/// @title Voting with delegation.
contract Ballot {
// This declares a new complex type which will
// be used for variables later.
// It will represent a single voter.
struct Voter {
uint weight; // weight is accumulated by delegation
@Tee-py
Tee-py / school.sol
Created February 27, 2022 17:29
Web3Bridge School Smart Contract
//SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.5;
contract School {
struct Instructor {
string name;
uint age;
}