Skip to content

Instantly share code, notes, and snippets.

View jmcph4's full-sized avatar

Jack McPherson jmcph4

View GitHub Profile
/* $ gcc tree.c -Wall -Wextra -Wshadow -std=c11 -pedantic -o tree */
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
struct Vertex {
uint8_t data;
struct Vertex* left;
struct Vertex* right;

System Information

Version: 8ad7d05

$ uname -a
Linux [REDACTED] 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
$ reth --version
reth Version: 1.1.0
Commit SHA: 1ba631ba9581973e7c6cadeea92cfe1802aceb4a
Build Timestamp: 2024-10-10T18:21:22.096485546Z
[package]
name = "checkpoint"
version = "0.1.0"
edition = "2021"
[dependencies]
alloy = { version = "0.6", features = ["full"] }
amms = { git = "https://github.com/darkforestry/amms-rs.git", rev = "8ad7d05" }
eyre = "0.6.12"
tokio = { version = "1.42.0", features = ["full"] }
@jmcph4
jmcph4 / endian.c
Last active December 15, 2024 23:44
C program to determine the endianness of the host machine. It must print "B" or "L" to standard output if the host machine is big or little endian, respectively.
#include <stdio.h>
int main(){unsigned int x=1;char*c=(char*)&x;*c?printf("B"):printf("L");}
fn r#match<'a>(
&mut self,
order: T,
opposing_side: impl Iterator<Item = (&'a F64, &'a mut VecDeque<T>)>,
) where
T: 'a,
{
let reduce_depth = |reduction| {
let curr_depth = *self.depth.read().unwrap();
match order.kind() {
@jmcph4
jmcph4 / pumpgrad.py
Created November 30, 2024 01:30
Retrieve upcoming Pump.fun graduations and write them to the standard output in a tabulated, human-readable format
from typing import List, Tuple
import requests
def get_graduations() -> List[Tuple[str, str, float]]:
url = "https://advanced-api.pump.fun/coins/about-to-graduate"
resp = requests.get(url)
if resp.status_code == 200:
return [
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#!/bin/bash
# Name of the program to monitor (provide the full path if not in PATH)
PROGRAM="your_program"
PROGRAM_ARGS="--arg1 --arg2" # Replace with the program's arguments
# Ensure the script is running as root to read dmesg
if [ "$EUID" -ne 0 ]; then
echo "This script must be run as root to monitor OOM events."
exit 1
use arbitrary::{Arbitrary, Unstructured};
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use ironlobe::{
book::{
btree_book::{BTreeBook, Metadata},
Book,
},
order::PlainOrder,
};
use rand::{thread_rng, RngCore, SeedableRng};

IEEE Citation Style Bibliography

[1] V. Buterin, "Proposer/Builder Separation (PBS) Spec," Ethereum Foundation, Jul. 2022. [Online]. Available: https://notes.ethereum.org/@vbuterin/proposer_builder_separation

[2] Flashbots, "Introducing MEV-Boost: Empowering Ethereum Stakers," Flashbots Blog, Jun. 2022. [Online]. Available: https://flashbots.net/blog/mev-boost-intro

[3] S. Gao, "A Survey on Maximal Extractable Value (MEV): Concepts, Techniques, and Future Directions," IEEE Access, vol. 10, pp. 78590–78605, Aug. 2022.

[4] S. Eskandari, J. Clark, M. Moeini, and M. Vasek, "SoK: MEV and Flash Loans: Threats and Mitigations," in Proceedings of the 2022 ACM SIGSAC Conference on Computer and Communications Security (CCS), Nov. 2022, pp. 1–18.