This "head_tail_file" gist is a contrived example of a command line utility facilitating AI code generation experimentation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/python | |
# | |
# F R O N I U S P V _ G R A P H . P Y | |
# | |
# Last Modified on Thu Apr 17 20:47:00 2025 | |
# | |
# Code to graph the real-time power/energy and voltage data from a Fronius inverter | |
# | |
###################################################################################### | |
# This code started out as AI (ChatGPT) generated code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# | |
# This shell script allows a quick check on whether Apple have done | |
# anything about the feedback on the short-comings of MacOS ping. | |
# | |
# Needs to have a target that responds to ICMP requests (i.e. ping request). | |
# In my case my local router (192.168.1.1) responds to ICMP requests apart from | |
# MASK_REQ. Edit "LOCAL_IP_ROUTER" value to suit a different network setup. | |
# | |
LOCAL_IP4_ROUTER=192.168.1.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// T R Y _ 1 _ U T F 8 _ C H A R | |
// | |
// try_1_utf8_char.rs last edited on Sat Feb 22 16:09:31 2025 | |
// | |
// Display a character from the UTF-8 bytes (or Unicode code point) specified | |
// on the command line. | |
// | |
// N.B. 1. The quickest and easiest access to similar, and probably | |
// better, functionality as this rust code is to use the following |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// F I L E _ B Y T E _ D I S P L A Y | |
// | |
// File Byte display | |
// | |
// Display the bytes in a small file, or the first 1000 bytes | |
// of a larger file. | |
// | |
// Warning: lacks adequate command line parameter checking | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* T Y P O S . C | |
* | |
* modified version that can be compiled by gcc | |
* Original T Y P O S is shown in a listing found on URL | |
* https://archive.org/details/68micro-vol-04-num-11/page/n35/mode/1up | |
*/ | |
/*************************************************************/ | |
/* Written by: Jodie A. Zoeller, SWTPc, August 1982 */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* R T I M E E X A M P L E | |
* | |
*/ | |
/* | |
* Manpage example for rtime() slightly modified | |
* compile on Ubuntu 20.04 LTS or older LTS version | |
* cc -Wall -o rtimeExample rtimeExample.c | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python3 | |
# | |
# C 4 | |
# | |
# This code attempts to play the game of Connect 4 | |
# using: text mode input and output. | |
# | |
# Last edited Mon Apr 3 20:58:53 2023 | |
# | |
# c4 doesn't incorporate much game awareness in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Start of BASIC! Program | |
prgName$="GPS Server" | |
prgVer$="2" | |
! Set Update interval to 2 sec & Server port to 52345 | |
intrvl=2000 | |
srvrSckt=52345 | |
! | |
verNum=val(version$()) | |
GPS.open stts, intrvl | |
if stts <> 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Start of BASIC! Program | |
print "Hello world, courtesy of Basic! version " version$() | |
REM | |
print "Sensor List "; | |
sensors.list sensorarray$[] | |
array.length size,sensorarray$[] | |
print "("; | |
print format$("##",size); | |
print " item"; | |
if size <> 1 then print "s"; |
NewerOlder