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 / playground.rs
Created July 20, 2024 16:52 — forked from rust-play/playground.rs
Code shared from the Rust Playground
fn random() {
let num1 = vec![2, 3];
let num2 = vec![2, 3];
let address1 = &num1 as *const Vec<i32>;
let address2 = &num2 as *const Vec<i32>;
let number1 = address1 as i32;
let number2 = address2 as i32;
let modulus: i32 = 13;
// println!("{}", number1);
@RandyMcMillan
RandyMcMillan / playground.rs
Created July 20, 2024 16:10 — forked from rust-play/playground.rs
Code shared from the Rust Playground
fn random() {
let num1 = vec![2, 3];
let num2 = vec![2, 3];
let address1 = &num1 as *const Vec<i32>;
let address2 = &num2 as *const Vec<i32>;
let number1 = address1 as i32;
let number2 = address2 as i32;
println!("{}", number1 % 13);
println!("{}", number2 % 13);
}
@RandyMcMillan
RandyMcMillan / GNUmakefile
Created July 19, 2024 12:40
make:docker-start
ifeq ($(project),)
PROJECT_NAME := $(notdir $(PWD))
else
PROJECT_NAME := $(project)
endif
export PROJECT_NAME
VERSION :=$(shell cat version)
export VERSION
TIME :=$(shell date +%s)
@RandyMcMillan
RandyMcMillan / build.rs
Created July 19, 2024 12:17
generic build.rs
// build.rs
use std::env;
use std::fs;
use std::path::Path;
fn main() {
let out_dir = env::var_os("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("hello.rs");
fs::write(
// build.rs
use std::env;
use std::fs;
use std::path::Path;
fn main() {
let out_dir = env::var_os("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("hello.rs");
fs::write(
@RandyMcMillan
RandyMcMillan / GNUmakefile
Created July 10, 2024 20:02
make:install-nvm
install-nvm:
@curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash || \
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
@. $(HOME)/.nvm/nvm.sh &>/dev/null && nvm install $(shell cat .nvmrc) &>/dev/null && nvm use
@RandyMcMillan
RandyMcMillan / main.rs
Created January 30, 2024 03:28 — forked from rot13maxi/main.rs
adaptor fun
use rand_chacha::ChaCha20Rng;
use schnorr_fun::fun::{KeyPair, Scalar};
use schnorr_fun::{Message, nonce, Schnorr};
use schnorr_fun::adaptor::Adaptor;
use schnorr_fun::fun::marker::Public;
use schnorr_fun::musig::MuSig;
use sha2::Sha256;
fn main() {
// Little proof of concept. Doesn't actually do real transactions, but you get the idea.
@RandyMcMillan
RandyMcMillan / makefile
Created December 4, 2023 19:09 — forked from tomdaley92/makefile
Generic makefile for C/C++ programs
# Thomas Daley
# September 13, 2021
# A generic build template for C/C++ programs
# executable name
EXE = app
# C compiler
CC = gcc
@RandyMcMillan
RandyMcMillan / key_converter.py
Last active December 1, 2023 00:11 — forked from jleo84/key_converter.py
Convert any Bitcoin key prefix to another (e.g.: xpub to ypub, zpriv to Zpriv)
#!/usr/bin/python3
import pip
while True:
try:
#import your modules here. !
from distutils.spawn import find_executable
from shutil import which
@RandyMcMillan
RandyMcMillan / .gitignore
Last active September 7, 2023 23:14
clone gitHub organization
gnostr-org