Skip to content

Instantly share code, notes, and snippets.

View JayKickliter's full-sized avatar
💭
Cache Rules Everything Around Me

Jay Kickliter JayKickliter

💭
Cache Rules Everything Around Me
View GitHub Profile
@JayKickliter
JayKickliter / worldcover.rs
Created April 2, 2024 22:36
ESA worldcover (land-type) typedefs
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[repr(u8)]
pub(crate) enum WorldCover {
Tree = 10,
Shrub = 20,
Grass = 30,
Crop = 40,
Built = 50,
Bare = 60,
Frozen = 70,
@JayKickliter
JayKickliter / build_arm_gdb.sh
Last active March 14, 2024 20:36
Building `arm-none-eabi-gdb` with python support
#!/usr/bin/env sh
export TARGET=arm-none-eabi
export PREFIX=$HOME/.local
export PATH=$PATH:$PREFIX/bin
export VERSION=7.8.1
export GDB=gdb-$VERSION
rm -rf $GDB
@JayKickliter
JayKickliter / coord_or_hex.rs
Created February 23, 2024 17:55
Parsing coordinate or h3 hex from cli in rust
use h3o::LatLng;
use h3o::Resolution;
use hextree::Cell;
use std::str::FromStr;
#[derive(Debug, Clone, Copy)]
pub struct CoordOrHex(Cell);
impl FromStr for CoordOrHex {
type Err = anyhow::Error;
@JayKickliter
JayKickliter / parse_range.rs
Created February 19, 2024 17:19
Parsing a range of values in rust, suitable for command line clap parsing
// https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=7d2fd8dc461ab1fc7216eb4e68c4517d
use std::str::FromStr;
#[derive(Clone, Debug, Eq, PartialEq)]
pub(crate) enum ResOpt {
Fixed(u8),
Range(u8, u8),
}
@JayKickliter
JayKickliter / jeep-mods.md
Last active January 31, 2024 21:21
My Jeep mods

DSCF7893-HDR

  • Teraflex Falcon Nexus EF 2.2 Steering Stabilizer
  • Teraflex Falcon Shocks 3.3 Adjustable Piggyback front & rear. Rear has skid plate.
  • 3" lift
  • TigerShark Super Winch 9500 With Synthetic Line
  • Metal cloak Frame built Front bumper
  • Metal cloak front and rear Control Arms
  • Metal cloak Rear Track Bar (installed 6Months ago.
  • Metal cloak Tie rod and Drag link
@JayKickliter
JayKickliter / download.sh
Last active January 15, 2024 01:42
Download all ESA WorldCover tiles
#!/bin/bash
set -ex
for lat in "S90" "S30" "N30"; do
for lon in "E000" "E060" "E120" "W060" "W120" "W180"; do
file_name=ESA_WorldCover_10m_2021_v200_60deg_macrotile_$lat$lon.zip
wget https://worldcover2021.esa.int/data/archive/$file_name
unzip $file_name
rm $file_name
@JayKickliter
JayKickliter / main.rs
Created January 14, 2024 23:40
ESRI Land Cover + GeoTIFF + Rust + GDAL + Projection
use anyhow::Result as AnyRes;
use gdal::{
spatial_ref::{CoordTransform, SpatialRef},
Dataset, GeoTransformEx,
};
fn main() -> AnyRes<()> {
let ds = Dataset::open("lulc2022/17R_20220101-20230101.tif")?;
// WGS84
@JayKickliter
JayKickliter / interlaced_ntsc.v
Last active December 2, 2023 13:32
NTSC in Verilog
module interlaced_ntsc (
input wire clk,
input wire [2:0] pixel_data, // 0 ( black )..5 (bright white)
output wire h_sync_out, // single clock tick indicating pixel_y will incrememt on next clock ( for debugging )
output wire v_sync_out, // single clock tick indicating pixel_y will reset to 0 or 1 on next clock, depending on the field ( for debugging )
output wire [9:0] pixel_y, // which line
output wire [9:0] pixel_x,
output wire pixel_is_visible,
output reg [2:0] ntsc_out
@JayKickliter
JayKickliter / README.md
Created October 24, 2023 22:31
Rust with Address Sanitizer on M1 macOS

Usage:

$ ASAN_OPTIONS="detect_leaks=1:halt_on_error=0"  RUSTFLAGS="-Z sanitizer=address" cargo +nightly run -Z build-std=core,alloc --target aarch64-apple-darwin

Output:

    Finished dev [unoptimized + debuginfo] target(s) in 0.07s