Skip to content

Instantly share code, notes, and snippets.

View NotoriousPyro's full-sized avatar

NotoriousPyro

View GitHub Profile
@NotoriousPyro
NotoriousPyro / OutlookAutostartAndMinimise.ps1
Last active August 18, 2025 17:26
Automatically finds, runs and places Outlook into the system tray.
<#
.Synopsis
Automatically finds, runs and places Outlook into the system tray.
.Description
Automatically finds, runs and places Outlook into the system tray.
By default, Outlook will start full-screen even when you have the option to minimize tray enabled and start the app as minimized.
@NotoriousPyro
NotoriousPyro / transmission_removecompleted.ps1
Created September 18, 2019 00:48
Transmission RPC to PowerShell Object calls example. Removes torrents which are completed. I may make this into a tool when I get more time.
$transmission = Join-Path "C:\Program Files\Transmission" transmission-remote.exe
$server = "127.0.0.1:9091"
function GetTorrentObjectList {
param (
$TorrentList
)
$torrents = [Collections.ArrayList]@()
foreach ($torrent in $TorrentList[1..($TorrentList.Count - 2)]) {
@NotoriousPyro
NotoriousPyro / bitfinex.css
Created October 29, 2020 23:50
Bitfinex Stylebot Settings (for larger screens)
#sidebar-widget div.custom-scrollbar.custom-scrollbar {
width: 100;
height: 990px;
padding: 0px 0px 30px;
}
div.tickerlist__container {
height: 1000px;
}
@NotoriousPyro
NotoriousPyro / Cardano-topology-builder.ps1
Last active February 24, 2021 21:55
Builds a topology for use with cardano-node. Set your own block producing relays inside the $newRelays object. Only looks for relays with addresses like *relays* but you can easily customise it. Creates a file called mainnet-topology.json
$relays = Invoke-WebRequest -Uri https://explorer.mainnet.cardano.org/relays/topology.json | ConvertFrom-Json
$relays2 = $relays.Producers | Where-Object {
$_.addr -like '*relays*'
} | Sort-Object { $_.addr -eq 'relays-new.cardano-mainnet.iohk.io' } -Descending
$newRelays = @{
"Producers" = [Collections.ArrayList]@(
@{
"addr" = "127.0.0.1"
@NotoriousPyro
NotoriousPyro / connection-manager.ts
Created March 15, 2024 21:31
ConnectionManager Solana class for SexBot
import {
Instruction,
SwapInstructionsResponse
} from "@jup-ag/api";
import {
AddressLookupTableAccount,
ComputeBudgetProgram,
Connection,
Keypair,
PublicKey,
@NotoriousPyro
NotoriousPyro / jupiter-pricemgr.tests.ts
Last active April 2, 2024 03:21
Tests for a class implementing Jupiter's QuoteResponse for profitable quotes. Here is the test, you must implement the class... good luck!
// By Pyro @ www.sexonsol.com
// Price class, basic types and interface for PriceManager provided for you:
import { QuoteResponse } from '@jup-ag/api';
import { BigNumber } from 'bignumber.js';
enum WellKnownTokenMint {
USDC = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
USDCet = "A9mUU4qviSctJVPJdBJWkb28deg915LYJKrzQ19ji3FM",
@NotoriousPyro
NotoriousPyro / asynclogger.ts
Last active September 12, 2024 21:49
Asynchonrous Promise-based logger
// By Pyro @ www.sexonsol.com
import { Console } from "node:console";
type LogLevel = "INFO" | "ERROR" | "WARN" | "DEBUG" | "TRACE";
/** Asynchronous Promise-based logger */
export default class AsyncLogger extends Console {
public name: string;
constructor(name: string) {
super({
@NotoriousPyro
NotoriousPyro / anchor-errors-example.ts
Last active May 13, 2024 16:34
Error handling with Anchor
// Here is a portion of the code used in sexbot.sol that handles errors when sending txs
/**
* Anchor can't handle all errors for some reason, so this exists to handle those cases
* @param logs
* @returns
*/
export const extractErrorDetailFromLogs = (
logs: string[]
@NotoriousPyro
NotoriousPyro / web3js-typescript-retry-fetcher.ts
Last active May 22, 2024 00:02
Example TypeScript web3.js with retry fetcher
import * as nodeFetch from 'node-fetch';
import fetch from 'fetch-retry'
import https from 'https';
const _fetch = fetch(nodeFetch.default);
type FetchFn = typeof nodeFetch.default;
export type Fetcher = (...args: Parameters<FetchFn>) => ReturnType<FetchFn>;
export type RetryFetcherWithCustomAgent = (agent: https.Agent) => Fetcher;
export const RetryFetcher: Fetcher = (...args) => {
const [url, init] = args;
@NotoriousPyro
NotoriousPyro / AddressLookupTableDB.ts
Last active May 21, 2024 22:36
Example database for caching Solana AddressLookupTableAddresses in memory using lmdb.js
import { RootDatabaseOptionsWithPath, open } from 'lmdb';
import { addressLookupTableDBPath } from '../const';
const _dbOptions: RootDatabaseOptionsWithPath = {
path: addressLookupTableDBPath,
cache: { // https://github.com/kriszyp/weak-lru-cache#weaklrucacheoptions-constructor
cacheSize: 16777216, // 16MB - maximum
clearKeptInterval: 100,
txnStartThreshold: 3