Skip to content

Instantly share code, notes, and snippets.

View RandyMcMillan's full-sized avatar
🛰️
Those who know - do not speak of it.

@RandyMcMillan RandyMcMillan

🛰️
Those who know - do not speak of it.
View GitHub Profile
@RandyMcMillan
RandyMcMillan / psuedo_rand_bloch_vec.rs
Last active March 22, 2025 15:18 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::time::{SystemTime, UNIX_EPOCH};
const EPSILON_TWEAK: f64 = f64::EPSILON * /*adjust for granularity*/ 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002;
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct BlochVector {
pub x: f64,
pub y: f64,
pub z: f64,
}
@RandyMcMillan
RandyMcMillan / global_rt.rs
Created March 26, 2025 04:04 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use once_cell::sync::OnceCell;
// global_rt
pub fn global_rt() -> &'static tokio::runtime::Runtime {
static RT: OnceCell<tokio::runtime::Runtime> = OnceCell::new();
RT.get_or_init(|| tokio::runtime::Runtime::new().unwrap())
}
#[cfg(test)]
mod tests {
@RandyMcMillan
RandyMcMillan / install_nvm.rs
Created March 31, 2025 11:35 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::env;
//use std::env::consts::OS;
use std::fs;
use std::path::Path;
use std::process::{Command, Stdio};
use std::str;
fn nvm_has(command: &str) -> bool {
Command::new("type")
.arg(command)
@RandyMcMillan
RandyMcMillan / self_bytes.rs
Created March 31, 2025 12:04 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::str;
fn main() {
let self_bytes: &[u8] = include_bytes!("main.rs");
match str::from_utf8(self_bytes) {
Ok(s) => println!("{}", s),
Err(e) => println!("Error: {}", e),
}
}
@RandyMcMillan
RandyMcMillan / empty_playground.rs
Created March 31, 2025 12:07 — forked from rust-play/playground.rs
Code shared from the Rust Playground
//
@RandyMcMillan
RandyMcMillan / env_var_loop.rs
Last active April 3, 2025 12:02 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::env;
fn env_vars() {
// Iterate over all environment variables.
for (key, value) in env::vars() {
println!("{}: {}", key, value);
}
// You can also filter the environment variables.
println!("\nFiltered environment variables:");
@RandyMcMillan
RandyMcMillan / print_cargo_toml.rs
Created April 3, 2025 12:10 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::env;
fn env_vars() {
// Iterate over all environment variables.
for (key, value) in env::vars() {
println!("{}: {}", key, value);
}
// You can also filter the environment variables.
println!("\nFiltered environment variables:");
@RandyMcMillan
RandyMcMillan / usize_overflow.rs
Created April 12, 2025 15:07 — forked from rust-play/playground.rs
Code shared from the Rust Playground
fn main() {
let max_usize = std::usize::MAX;
println!("std::usize::MAX/2: {}", std::usize::MAX / 2);
if !is_debug() {
let overflow_release = max_usize.wrapping_add(1);
println!("Overflow: {}", overflow_release); // Output in release: 0
} else {
#[warn(arithmetic_overflow)]
#[cfg(debug_assertions)]
@RandyMcMillan
RandyMcMillan / sha2-to-png.rs
Last active May 18, 2025 14:26 — forked from rust-play/playground.rs
sha2-to-png.rs
use image::{ImageBuffer, Rgb};
use sha2::{Digest, Sha256};
const COLORS: [&str; 256] = [
"#c4b9b8", "#879f84", "#a6814c", "#ff9966", "#aa1155", "#7a81ff", "#8e473b", "#f3dfb6",
"#dfac4c", "#4b3621", "#feff32", "#a57c5b", "#52b4ca", "#fffc79", "#879877", "#bb1133",
"#eee9d9", "#52b4d3", "#ffff81", "#4f4554", "#c68f65", "#d2e7ca", "#0000ff", "#2ee8bb",
"#eebb88", "#eddd59", "#7f5f00", "#eeaa11", "#35fa00", "#ffefd6", "#bb11aa", "#dab4cc",
"#fff0db", "#987d73", "#c4fff7", "#eae0c8", "#e2c779", "#ff4d00", "#334d41", "#f83800",
"#ddedbd", "#ffdd44", "#efd7ab", "#66eeee", "#aa3333", "#006663", "#ffb75f", "#c6bb9c",

Caveat Emptor

I (instagibbs) was asked to draft a statement, I feel this is a fair summation of the project's direction. I might be wrong

Retiring the 80-Byte OP_RETURN Limit

Bitcoin Core’s next release will, by default, relay and mine transactions whose OP_RETURN outputs exceed 80 bytes and allow any number of these outputs. The long-standing cap, originally a gentle signal that block space should be used sparingly for non-consensus data has outlived its utility.