Skip to content

Instantly share code, notes, and snippets.

View berkakinci's full-sized avatar

Berk Akinci berkakinci

View GitHub Profile
@berkakinci
berkakinci / BitMask.hpp
Last active December 27, 2025 19:34
Bit manipulation is easy in Verilog HDL. It is still tedious in C++, but the language is evolving for the better.
/*
* An example showing use of consteval functions and constructors
* to create and use bit masks.
*
* Berk Akinci
* December 17, 2025
*
*/
#ifndef UTILITY_BITMASK_HPP
@berkakinci
berkakinci / gcode_to_csv.py
Last active September 3, 2025 02:10
Convert Some 3D Printer (or other) G Code to CSV format for data analysis. I used this to diagnose a failing 3D print due to pathological layers over-utilizing retractions.
#!/usr/bin/env python
import sys
import re
import csv
# Define column headers for common G-code fields
parameters = ["X", "Y", "Z", "E", "F", "S", "T"]
fields = ["Command", *parameters, "Other", "Comment"]