Skip to content

Instantly share code, notes, and snippets.

View SimonEast's full-sized avatar

Simon East SimonEast

  • Victoria, Australia
  • 17:20 (UTC +10:00)
View GitHub Profile
@SimonEast
SimonEast / README.md
Created June 30, 2026 10:56
commit-and-tag-version Search and Replace Script

commit-and-tag-version Search and Replace Script

commit-and-tag-version is a utility for incrementing (or "bumping") the semantic version number of your software. When run, it looks at your git history and decides whether the next version should be a major, minor or patch increment (or you can override this manually). By default, it is able to modify package.json (for JS/npm modules) and several other common file formats to contain the updated version number, rather than having to do it manually.

But if your version number is stored in files that commit-and-tag version doesn't support, you may need a script like this. In my case, I had some source code which printed out the version number within the program, for example:

$VERSION = "1.2.3-beta"
@SimonEast
SimonEast / .Intro.md
Last active February 13, 2024 01:47
8XP TI Calculator Tokens - binary and text representations

8XP TI Calculator Tokens

Binary representations vs text

The following file shows the commands and tokens used on a TI-84 Plus calculator program (an 8XP file).

The data closely matches the output of TI's official software "TI Connect CE" as much as possible, although not 100% exactly as there were a couple of bugs/issues as noted in comments inside the list below.

This list was designed to support TI-84+ monochrome programs. It does also include a number of TI-84+ CE (colour edition) tokens - but possibly not 100% of these.

Other token references:

@SimonEast
SimonEast / .8XP Binary File Format.md
Last active May 10, 2026 17:31
8XP Binary File Format & Structure Documentation

8XP File Format

The following KSY file shows the binary structure of 8XP files. These files are programs used on Texas TI-83 Plus and TI-84 Plus calculators.

As a basic summary, each 8XP file contains:

  • 55 byte header
  • 19 byte meta data section
  • body (variable length)
  • 2 byte checksum at the end
@SimonEast
SimonEast / .README.md
Last active November 24, 2022 16:21
Watching a Folder for Changed Files Using AutoIt Script

Watching a Folder for Changed Files Using AutoIt Script

The example scripts below show a clean way of monitoring a folder for changes and responding to those changes.

The _WinAPI_ReadDirectoryChanges() function provided by AutoIt is quite helpful for this, but unfortunately it is a "blocking" synchronous function, which means that once it is called, it hangs the script and users cannot exit it via the tray icon (well not until a file change is triggered). To workaround this, the scripts below run as a "parent" script and a "child" script. The parent runs the child in a separate process and if the parent is exited, it also exits the child process, which is clean and better for usability.

There's also some helpful comments included in the script, as well as an option of filtering file changes based on a specific file extension, if that's what you need.

Comments and feedback welcome.

@SimonEast
SimonEast / Tokens.md
Created February 25, 2022 02:49
List of TI-83/84 Basic Tokens

Here are all the TI-BASIC tokens, along with the binary hex code of each, as taken from TokenIDE. The hex form is how they appear in an 8XP file. Another list is available at http://tibasicdev.wikidot.com/tokens

00 - 
01 - ►DMS
02 - ►Dec
03 - ►Frac
04 - →
@SimonEast
SimonEast / Export CSV.php
Last active August 2, 2023 15:47
PHP Example: Stream a CSV File to Browser with GZIP Compression (exporting from MySQL/PDO)
<?php
/**
* This script performs a full dump of a database query into
* CSV format and pipes it directly to the browser.
*
* - YES, the browser will save the CSV file to disk
* - YES, it should support large files without using massive amounts of memory
* - YES, it compresses the request using GZIP to reduce download time
*/
@SimonEast
SimonEast / Language List.txt
Created January 16, 2018 00:05
List of Languages in their Native Script
en English
ceb Sinugboanong Binisaya
sv Svenska
de Deutsch
fr Français
nl Nederlands
ru Русский
it Italiano
es Español
war Winaray
@SimonEast
SimonEast / LanguageDetect.php
Created January 15, 2018 05:56
PHP: Choosing the closest matching language from Accept-Language header
<?php
/**
* So you have a list of languages your site supports
* and want to automatically assign the user to the closest
* one.
*
* Usage:
*
* LanguageDetect::findBestMatch(['en', 'fr', 'gr']);
* LanguageDetect::findBestMatchOrFallback(['en', 'fr', 'gr']);
@SimonEast
SimonEast / curl_function.php
Last active October 27, 2025 10:40
PHP Curl (The Easy Way)
<?php
/**
* Easy remote HTTP requests using a single function
* (How curl probably SHOULD have been written originally)
*
* If you need something more advanced/robust, use 'guzzle'
* But this function is useful for when you don't need a massive library,
* but rather something simpler and more lightweight
*
* Examples:
@SimonEast
SimonEast / Acceptance.php
Last active March 11, 2021 15:07
Codeception - how to test for redirects
<?php
// Simply place the following two functions in _support/Helper/Acceptance.php
// Then you can call $I->verifyRedirect(...) inside your tests
namespace Helper;
class Acceptance extends \Codeception\Module
{
/**
* Ensure that a particular URL does NOT contain a 301/302