Skip to content

Instantly share code, notes, and snippets.

@o-murphy
o-murphy / workflow-remove-by-file.ps1
Last active June 13, 2025 10:02
Delete Specific GitHub Workflow Runs
param (
[string]$Owner,
[string]$Repo,
[string]$WorkflowFileName, # Changed parameter for specific workflow file name
[switch]$Delete = $false, # Set to $true to perform deletion of all except the latest
[switch]$DeleteAll = $false # New flag: set to $true to perform deletion of ALL runs, including the latest
)
# Check if GitHub CLI (gh) is installed
if (-not (Get-Command gh -ErrorAction SilentlyContinue)) {
# Your drag coefficient tables for G1 and G7 at different velocities
g1_drag = {
1000: 0.450,
1500: 0.410,
2000: 0.375,
2500: 0.350,
3000: 0.330,
}
g7_drag = {
@o-murphy
o-murphy / pydantic.py
Last active January 13, 2025 14:48
py_ballisticcalc.pydantic
from pydantic import BaseModel, validator, root_validator, confloat
from typing_extensions import Generic, TypeVar, Annotated, ForwardRef, get_type_hints, get_args, get_origin, Optional, Union, Literal
T = TypeVar('T')
from py_ballisticcalc import *
def isunion(annotation):
origin = get_origin(annotation)
if origin is Union:
@o-murphy
o-murphy / trajectory_calc.html
Created January 11, 2025 22:05
py_ballisticcalc.exts annotate
<!DOCTYPE html>
<!-- Generated by Cython 3.0.11 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cython: trajectory_calc.pyx</title>
<style type="text/css">
body.cython { font-family: courier; font-size: 12; }
@o-murphy
o-murphy / client.html
Created June 17, 2024 20:30
Simple server/client for frames stream
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Streaming Example</title>
<style>
#loading {
position: fixed;
width: 100%;
@o-murphy
o-murphy / README.md
Last active May 15, 2024 14:48
Simple recurcive file renamer

Usage

Add patterns to pattern variable as needed

patterns=("*.bak" "*.jpg" "*.upg" "*.mp4" "*.tar" "*.upg" "*.tar.gz" "*.mp4" "*.jpeg" "*.png" "*.svg" "*.txt" "*.md")

Run

chmod +x ./rrenamer
./rrenamer ./<target_dir>
@o-murphy
o-murphy / README.md
Last active April 28, 2024 15:46
simple binary search

build

gcc -shared -o binsearch.so curve.c

gcc -shared -o binsearch.dll curve.c
title = "308win sierra match king 168gr"
[pybc.preferred_units]
angular = 'Degree'
distance = 'Yard'
velocity = 'FPS'
pressure = 'InHg'
temperature = 'Fahrenheit'
diameter = 'Inch'