Skip to content

Instantly share code, notes, and snippets.

View jongan69's full-sized avatar
🎯
WEB3D

Jonathan Gan jongan69

🎯
WEB3D
View GitHub Profile
@jongan69
jongan69 / .env
Last active October 30, 2024 01:07
Lockin Bot??? RSI??? someone plz shoot me
OX_API_KEY=
OX_API_SECRET=
{
"version": "0.1.0",
"name": "pump",
"instructions": [
{
"name": "initialize",
"docs": [
"Creates the global state."
],
"accounts": [
@jongan69
jongan69 / decryptionFunctions.js
Last active May 29, 2024 23:36
Runemilio Jazz
// Function to pad a given key to a length of 32 bytes using the CryptoJS library
function padKey(e) {
// Convert the input string 'e' to a UTF-8 encoded WordArray
let t = CryptoJS.enc.Utf8.parse(e);
// Create an empty WordArray to store the padded key
let n = CryptoJS.lib.WordArray.create();
// Concatenate the UTF-8 encoded WordArray 't' to 'n'
n.concat(t);
@jongan69
jongan69 / Readme.md
Created January 30, 2023 05:22
A smart contract for managing todo tasks

TaskContract

A smart contract for a Todo App on the Ethereum blockchain.

Overview

TaskContract is a smart contract for a Todo App on the Ethereum blockchain. It allows users to add tasks and delete tasks. It also allows users to view their own tasks.

Functions

TaskContract has the following functions:

  • addTask(string memory taskText, bool isDeleted) - adds a new task to the contract.
@jongan69
jongan69 / Readme.md
Last active January 30, 2023 05:01
A Custom React Hook using Ref Pattern

useTimeout

A custom React Hook that allows you to call a callback after a specified delay.

Usage

import { useTimeout } from './useTimeout';

const callback = () => {
@jongan69
jongan69 / Blink.js
Last active January 30, 2023 05:57
GPIO Node interfacing
@jongan69
jongan69 / removeYouTubeTranscriptTimestamp.js
Created November 23, 2022 19:02
Console Script for Removing YouTube Video Transcript Timestamps
javascript:document.querySelectorAll('div.segment-start-offset').forEach(r => r.remove())
@Xavier59
Xavier59 / privatekeysolana.js
Created December 28, 2021 14:49
Convert Solana private key from/to base58/uint8array
// exporting from a bs58 private key to an Uint8Array
// == from phantom private key to solana cli id.json key file
// npm install bs58 @solana/web3.js
const web3 = require("@solana/web3.js");
const bs58 = require('bs58');
let secretKey = bs58.decode("[base58 private key here]");
console.log(`[${web3.Keypair.fromSecretKey(secretKey).secretKey}]`);
// exporting back from Uint8Array to bs58 private key