Skip to content

Instantly share code, notes, and snippets.

View LightningStalker's full-sized avatar

LightningStalker

View GitHub Profile
@LightningStalker
LightningStalker / fl.cpp
Created December 29, 2025 12:26
Another demo for the C++ hexdump of previous gist (need the hxd.hpp)
/* Compile with $ g++ -o fl fl.cpp
* Project Crew™ 12/28/2025
*/
#include <iostream>
#include <iomanip>
using namespace std;
#include "fl.hpp"
#include "hxd.hpp"
@LightningStalker
LightningStalker / hxd.cpp
Created December 29, 2025 12:26
C++ hex dump for debug, etc.
/* Compile with $ g++ -o hxd hxd.cpp
* Demonstration of the hexadecimal dumper for the char[]
* Project Crew™ 12/28/2025
*/
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
@LightningStalker
LightningStalker / WC.ASM
Last active December 19, 2025 22:13
"wc" - wordcount in asm for DOS, 8086 +
name wc
title WC.COM--word count
;--- assemble: uasm -bin -Fo WC.COM WC.ASM
display_char macro character
mov dl, character
mov ah, 02h
int 21h
endm
@LightningStalker
LightningStalker / dirshma.sh
Created November 22, 2025 11:03
make you directry disappear
#!/bin/bash
if [ -d "${1}" ]
then
echo -n 'dirshma.sh: '
rename -v 'y/ -~/0/' "${1}"
until
echo -n 'dirshma.sh: '
rename -v 's/0//' 0*
rmdir 0 2> /dev/null
do
@LightningStalker
LightningStalker / bucks.c
Created September 11, 2025 10:06
Buck converter calc
/* Compile with $ gcc -Wall -o bucks bucks.c
* For Watcom: $ wcl -bcl=$(DEST_OS) -wx -fe=$(EXE_file) bucks.c
* or use make
* Buck converter Power State calculator
* Formuli from SLVA477B by TI, Rev. 8/2015
* C adaptation by Project Crew 2024
*/
#include <stdio.h>
#include <stdlib.h>
@LightningStalker
LightningStalker / beacondist.cpp
Last active September 5, 2025 23:40
distance to station based on RSSI and reference station
/* distance to station based on RSSI and reference station
* stations must be very very close to same
* Project Crew™ 9/3/2025
*/
#include <iostream>
#include <cmath>
#include <exception>
#include <filesystem>
using namespace std;
@LightningStalker
LightningStalker / dec2sex.c
Last active August 27, 2025 12:55
Convert decimal GPS coordinates into sexagesimal
/* Compile with gcc -Wall -o dec2sex dec2sex.c -lm */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main (int argc, char **argv)
{
int d, m, s, ms;
double mm, ss;
@LightningStalker
LightningStalker / sex2dec.c
Last active August 27, 2025 12:58
Convert sexagesimal GPS coordinates into decimal
/* Compile with gcc -Wall -o sex2dec sex2dec.c */
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char **argv)
{
if (argc == 5)
{
printf ("%f\n", atoi(argv[1])
@LightningStalker
LightningStalker / Makefile
Created August 16, 2025 08:48
Build all programs in the current directory
# It builds all programs in the current directory.
SUFFIX := cpp
BASENAME := basename
ECHO := /bin/echo
RM := rm
TEST := /bin/test
XARGS := xargs
@LightningStalker
LightningStalker / neoblink.ino
Created August 2, 2025 04:27
Neopixel blink sketch example