Skip to content

Instantly share code, notes, and snippets.

@flaminggoat
flaminggoat / moon_crop.py
Last active August 16, 2026 14:12
Crop crescent-moon / eclipse images so the moon is centred in the output image, with a configurable border around it.
#!/usr/bin/env python3
"""
moon_crop.py
Crop crescent-moon / eclipse images so the moon is centred in the output
image, with a configurable border around it.
The moon's centre is found by fitting a circle to the OUTER circumference
of the moon's disc (not the terminator - the light/dark boundary on a
crescent), using:
@flaminggoat
flaminggoat / main.rs
Created March 3, 2023 21:23
ESP32 SD card access from Rust using esp_idf_sys
use std::io::{BufWriter, Write};
use std::ptr::{null, null_mut};
use std::time::Instant;
use esp_idf_sys as _; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported
use esp_idf_sys::c_types::{c_int, c_void};
use std::fs::{self, File};
fn main() {
boot v1.17 (216T-CA)
^^RAM START (0x40400000)
***********************************************
* Eldon Technology Ltd. Bootloader (c) 2005 *
***********************************************
Info only: download v1.00 on Sep 7 2009 at 16:00:48