Skip to content

Instantly share code, notes, and snippets.

@jarroddavis68
jarroddavis68 / interface_factory.pas
Last active November 5, 2021 13:08
Interface factory Example
program interface_factory;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
System.Generics.Collections;
@jarroddavis68
jarroddavis68 / InterfaceFactory.pas
Created November 5, 2021 23:41
InterfaceFactory - Manage a list is generic NoRef counted interfaces.
(*******************************************************************************
InterfaceFactory - Manage a list is generic NoRef counted interfaces.
Copyright © 2021 tinyBigGAMES™ LLC
All Rights Reserved.
Website: https://tinybiggames.com
Email : support@tinybiggames.com
@jarroddavis68
jarroddavis68 / PiroGameToolkit.pas
Created November 18, 2021 19:43
Piro Game Toolkit Import Unit
{==============================================================================
_____
___________(_)____________
___ __ \_ /__ ___/ __ \
__ /_/ / / _ / / /_/ /
_ .___//_/ /_/ \____/
/_/ Game Toolkit™
Copyright © 2021 tinyBigGAMES™ LLC
All Rights Reserved.
@jarroddavis68
jarroddavis68 / ExecuteFile.pas
Last active December 9, 2021 06:26
Execute File
function ExecuteFile(ahWnd: Cardinal; const aFilename, aParams, aStartDir: string; aShowCmd: Integer; aWait: Boolean): Integer;
var
Info: TShellExecuteInfo;
ExitCode: DWORD;
begin
Result := -1;
FillChar(Info, SizeOf(Info), 0);
Info.cbSize := SizeOf(TShellExecuteInfo);
with Info do
begin
@jarroddavis68
jarroddavis68 / DeferDelFile.pas
Created January 9, 2022 21:36
Defer Delete File
procedure DeferDelFile(const aFilename: string);
var
LCode: TStringList;
LFilename: string;
procedure C(const aMsg: string; const aArgs: array of const);
var
LLine: string;
begin
LLine := Format(aMsg, aArgs);
@jarroddavis68
jarroddavis68 / StartupShutdownConsole.pas
Created February 6, 2022 00:30
Startup/Shutdown Console
procedure PostKey(aKey: word; const aShift: TShiftState; aSpeciaKey: Boolean);
{ ************************************************************
* Procedure PostKey
*
* Parameters:
* key : virtual keycode of the key to send. For printable
* keys this is simply the ANSI code (Ord(character)).
* shift : state of the modifier keys. This is a set, so you
* can set several of these keys (shift, control, alt,
* mouse buttons) in tandem. The TShiftState type is
@jarroddavis68
jarroddavis68 / uSpSingleton.pas
Last active April 4, 2022 21:12
Singleton Class Implementation
unit uSpSingleton;
interface
uses
System.SysUtils;
type
// 1. Add this unit to your project, then save-as a new unit file
@jarroddavis68
jarroddavis68 / uSpStringList.pas
Last active April 7, 2022 00:12
TSpStringList - Enhanced Delphi String List
unit uSpStringList;
interface
uses
System.SysUtils,
System.Classes;
type
{ TSpStringList }
unit uCaptureConsoleEvent;
interface
type
{ TCaptureConsoleEvent }
TCaptureConsoleEvent = procedure(aSender: Pointer; aLine: string);
procedure CaptureConsoleOutput(const aTitle: string; const aCommand: PChar; const aParameters: PChar; aSender: Pointer; aEvent: TCaptureConsoleEvent);
@jarroddavis68
jarroddavis68 / uSingleUnit.pas
Last active July 13, 2023 13:28
Combine multiple Delphi into a single unit
{==============================================================================
____ _
/ ___| _ __ __ _ _ __| | __
\___ \| '_ \ / _` | '__| |/ /
___) | |_) | (_| | | | <
|____/| .__/ \__,_|_| |_|\_\
|_| Game Toolkit™
Copyright © 2022 tinyBigGAMES™ LLC
All Rights Reserved.