Skip to content

Instantly share code, notes, and snippets.

@UweRaabe
UweRaabe / EncryptedZipFile.pas
Created October 14, 2022 21:46 — forked from jarroddavis68/EncryptedZipFile.pas
TZipFile with Password Encryption
{==============================================================================
.
.--: :
---- :---:
.----- .-.
.------ .
-------.
.-------- :
.--------- .:.
----------: .
@UweRaabe
UweRaabe / MyJsonDemo.dpr
Created November 9, 2021 10:39
Convert JSON to object structure
program MyJsonDemo;
{$APPTYPE CONSOLE}
uses
System.SysUtils,
REST.Json,
MyJsonTypes in 'MyJsonTypes.pas';
const
@UweRaabe
UweRaabe / ActionHelper.pas
Created January 27, 2020 13:25
class helper for TBasicAction to access OnChange event
unit ActionHelper;
interface
type
TActionHelper = class helper for TBasicAction
private
function GetOnChange: TNotifyEvent;
procedure SetOnChange(const Value: TNotifyEvent);
public
@UweRaabe
UweRaabe / installation.rst
Created October 31, 2019 10:56 — forked from UnderGreen/installation.rst
Installation instruction for Kallithea

Setting up Kallithea on Ubuntu Server 12.04

Preparation

  1. Install Ubuntu Server.
  2. Update Ubuntu with the commands:
type
TVariantArr = record
private
{ implementation may differ }
Data: Variant;
Arr: TArray<Variant>;
function GetItems(Index: Integer): Variant;
procedure SetItems(Index: Integer; const Value: Variant);
public
class operator Implicit(A: TVariantArr): Variant; overload;
@UweRaabe
UweRaabe / uDesignNote.pas
Created August 16, 2017 15:38
Delphi component to show some text file at design time
unit uDesignNote;
interface
uses
System.SysUtils, System.Classes, Vcl.Forms, Vcl.StdCtrls;
type
TDesignNote = class(TComponent)
private
<?xml version="1.0" encoding="utf-8"?>
<codetemplate version="1.0.0" xmlns="http://schemas.borland.com/Delphi/2005/codetemplates">
<template name="array[" invoke="auto">
<description>
sized array declaration
</description>
<author>
Uwe Raabe
</author>
@UweRaabe
UweRaabe / uNetUse.pas
Created November 28, 2016 10:57
add and delete a network connection
function NetUseAdd(const RemoteName: string): string;
var
NetResource: TNetResource;
dwResult, dwBufSize, dwFlags: DWORD;
hRes: DWORD;
localName: array[0..1024] of Char;
begin
dwFlags := CONNECT_REDIRECT;
ZeroMemory(@NetResource, sizeof(TNetResource));
with NetResource do begin
@UweRaabe
UweRaabe / uIsPermanentConnection.pas
Last active November 24, 2017 13:09
check if network connection is permanent
function IsPermanentConnection(const ALocalName: string): Boolean;
type
PNetResourceArray = ^TNetResourceArray;
TNetResourceArray = array [0 .. MaxInt div SizeOf(TNetResource) - 1] of TNetResource;
var
I, BufSize, NetResult: Integer;
Count, Size: LongWord;
NetHandle: THandle;
NetResources: PNetResourceArray;
begin
procedure TdmScripting.PrepareScripter(AScripter: TIDEScripter);
begin
AScripter.DefineClassByRTTI(TTwinCATVar);
AScripter.DefineClassByRTTI(TTwinCATVarBOOL);
AScripter.DefineClassByRTTI(TTwinCATVarBYTE);
AScripter.DefineClassByRTTI(TTwinCATVarINT);
AScripter.DefineClassByRTTI(TTwinCATVarLONG);
AScripter.DefineClassByRTTI(TTwinCATVarSINGLE);
AScripter.DefineClassByRTTI(TTwinCATVarDOUBLE);
AScripter.DefineClassByRTTI(TTwinCATVarSTRING);