Skip to content

Instantly share code, notes, and snippets.

View jongan69's full-sized avatar
🎯
WEB3D

Jongan69 jongan69

🎯
WEB3D
View GitHub Profile
@jongan69
jongan69 / Send_Text.py
Created May 11, 2025 19:08
Using Surge API for sending text messages in python
import requests
import json
import os
import dotenv
dotenv.load_dotenv()
# Surge API endpoint
url = "https://api.surge.app/messages"
@jongan69
jongan69 / alpaca_portfolio.py
Created May 10, 2025 23:24
Script for running portfolio metrics on alpaca portfolio
import os
import sys
import logging
from datetime import datetime, timedelta
import requests
from dotenv import load_dotenv
import yfinance as yf
from collections import Counter, defaultdict
import re
from alpaca.trading.client import TradingClient
@jongan69
jongan69 / fidelity_portfolio_analysis.py
Created May 10, 2025 23:10
A Script for running portfolio metrics against a fidelity brokerage account, uses FIDELITY_USERNAME, FIDELITY_PASSWORD, and FIDELITY_ACCOUNT_NUMBER to retrieve ofx data and parses it
import os
import datetime
import codecs
import re
from decimal import Decimal
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import yfinance as yf
from ofxtools.Client import OFXClient, InvStmtRq
@jongan69
jongan69 / alpaca_transfer.py
Created April 18, 2025 09:11
Automate Deposit and Withdrawals into alpaca account
import asyncio
import os
import requests
from dotenv import load_dotenv
load_dotenv(override=True)
async def transfer_to_alpaca(amount, direction):
try:
direction = "INCOMING" if direction == "IN" else "OUTGOING"
@jongan69
jongan69 / tokenUtilsUpdated.ts
Created January 20, 2025 20:52
Using Metaplex UMI for token data, reference lockin repo tokenUtils to see original
import { AddressLookupTableAccount, Connection, PublicKey, PublicKeyInitData, TransactionInstruction } from "@solana/web3.js";
// import { Metaplex } from "@metaplex-foundation/js";
import Bottleneck from "bottleneck";
import {
fetchDigitalAssetWithAssociatedToken,
mplTokenMetadata,
findMetadataPda} from '@metaplex-foundation/mpl-token-metadata'
import { fromWeb3JsPublicKey, toWeb3JsPublicKey } from '@metaplex-foundation/umi-web3js-adapters'
import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
import { fetchIpfsMetadata } from "./fetchIpfsMetadata";
@jongan69
jongan69 / coin_data.py
Last active March 20, 2025 06:02
A bunch of python Solami code, not sure what I was doing
from solders.pubkey import Pubkey # type: ignore
from spl.token.instructions import get_associated_token_address
from construct import Padding, Struct, Int64ul, Flag
from walletTradingFunctions.config import client
from walletTradingFunctions.constants import PUMP_FUN_PROGRAM
# from config import client
# from constants import PUMP_FUN_PROGRAM
def get_virtual_reserves(bonding_curve: Pubkey):
bonding_curve_struct = Struct(
@jongan69
jongan69 / powerpoint.py
Created December 26, 2024 19:21
Turn all of your github repos from the past year into a powerpoint
import os
# Set tokenizers parallelism before importing transformers
os.environ["TOKENIZERS_PARALLELISM"] = "false"
import subprocess
import json
import random
import requests
from pptx import Presentation
from pptx.util import Pt, Inches
@jongan69
jongan69 / Cargo.toml
Last active March 5, 2025 03:49
Example Solana Rust Lottery Program
[package]
name = "lottery"
version = "0.1.0"
description = "Created with Anchor"
edition = "2021"
[lib]
crate-type = ["cdylib", "lib"]
name = "lottery"
@jongan69
jongan69 / scrape.py
Created December 17, 2024 08:35
scrape vydamo_.exe
import tweepy
import os
import json
import time
from dotenv import load_dotenv
from datetime import datetime, timedelta
# Load environment variables from .env
load_dotenv()
@jongan69
jongan69 / UnfollowInactiveTwitterUsers.js
Last active December 30, 2024 14:08
Open x.com/following and paste this in the console
(async function unfollowInactiveUsers() {
// Define a delay function with random variability
const delay = (min, max) => new Promise((resolve) => setTimeout(resolve, Math.random() * (max - min) + min));
// Function to click the "Unfollow" button within the confirmation popup
async function confirmUnfollow() {
try {
// Select the "Unfollow" button in the confirmation dialog
const confirmButton = document.querySelector('button[data-testid="confirmationSheetConfirm"]');
if (confirmButton) {