Skip to content

Instantly share code, notes, and snippets.

View sminez's full-sized avatar
🚀

Innes Anderson-Morrison sminez

🚀
View GitHub Profile
@sminez
sminez / mouse-mover.rs
Last active March 21, 2025 13:41
Simple mouse warping for OSX
// A quick and dirty tool for warping the mouse cursor between screens on OSX.
use core_graphics::{
display::{CGDisplay, CGPoint, CGRect},
event::{CGEvent, CGEventTapLocation, CGEventType, CGMouseButton},
event_source::{CGEventSource, CGEventSourceStateID},
};
use std::{env, process::exit};
const KNOWN_ARGS: [&str; 4] = ["--back", "--no-click", "-h", "--help"];
@sminez
sminez / async_state_machine.rs
Last active February 25, 2025 16:12
(ab)using rust async/await to drive a little state machine
//! This is a little exploration of (ab)using async/await syntax + a dummy Waker to simplify
//! writing sans-io state machine code.
use std::{
cell::UnsafeCell,
future::Future,
io::{self, Cursor, ErrorKind, Read},
pin::{pin, Pin},
sync::Arc,
task::{Context, Poll, Wake, Waker},
};
@sminez
sminez / init.org
Created December 6, 2024 16:07
init.org

My Emacs Configuration

Sort out tangle on save for this file

For now, org-babel-tangle is working alright but auto-tangling on save would be good

Track start-up time

Org

@sminez
sminez / zayoure.zsh
Created November 4, 2024 07:58
A zsh AUR package manager
#!/usr/bin/env zsh
# Arch User Repository (AUR) querying and package install without the need for
# a full blown binary that breaks with system upgrades.
#
# That said, zayoure is intended as a minimal helper script around searching,
# cloning and building aur packages. It does not support the full command set
# of pacman and it does not 'helpfully' do things on your behalf. It IS verbose
# in explaining why it failed so read the output, read the source and try not
# to brick your system ;)
#
@sminez
sminez / main.rs
Created October 31, 2022 14:07
Example Penrose WM
use penrose::{
builtin::{
actions::{exit, log_current_state},
layout::{
messages::{ExpandMain, IncMain, ShrinkMain},
transformers::{Gaps, ReserveTop},
MainAndStack, Monocle,
},
},
core::{
'''
Checking alternative dice probabilities for Ironsworn
'''
from collections import defaultdict
import json
MODIFIERS = [0, 1, 2, 3, 4]
STRONG = "strong hit"
WEAK = "weak hit"
MISS = "miss"
@sminez
sminez / inverse_fours.rs
Last active April 14, 2020 08:21
checking inverses with arthroprod
//! See https://github.com/sminez/arthroprod for the main library
//! This program was written at the following hash: 05237efac5f49abb935a0dd62cbbd88b31759c5d
//! No further crates are required
#[macro_use]
extern crate arthroprod;
use std::collections::HashSet;
use arthroprod::algebra::operations::{full, AR};
use arthroprod::algebra::types::{Form, MultiVector};
@sminez
sminez / simple-prompt.zsh
Created July 8, 2019 21:19
My simple ZSH prompt
#!/usr/bin/env zsh
GIT_AHEAD="⇡"
GIT_BEHIND="⇣"
PROMPT_CHAR="$"
SEPARATOR=" "
# Specific color vars
COLOR=003
COLOR_SUDO=005
@sminez
sminez / get_ippsec_details.py
Last active June 5, 2024 12:10
Find examples of pen testing methods and tools in videos by Ippsec (as of 22nd January 2020)
#!/usr/bin/env python3
"""
Script used to pull down the current video descriptions from ippsec's youtube channel.
The raw output still has a few HTML tags that need to be manually removed and there
also seem to be multiple duplicates of videos that have been removed in the output
saved as ippsec-details.txt
"""
import re
import sys
@sminez
sminez / keybase.md
Created November 7, 2018 11:42
keybase.md

Keybase proof

I hereby claim:

  • I am sminez on github.
  • I am idam (https://keybase.io/idam) on keybase.
  • I have a public key ASAKykKLjc8yWMY51k2SnCGRpSpQytrLXqQEWyogLTQMUwo

To claim this, I am signing this object: