Skip to content

Instantly share code, notes, and snippets.

@ortuagustin
ortuagustin / EnumHelper.pas
Created February 4, 2017 19:49
EnumHelper.pas
unit EnumHelper;
interface
uses
System.SysUtils,
System.TypInfo,
System.Rtti;
type
@ortuagustin
ortuagustin / cloudSettings
Last active November 13, 2019 18:54
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-11-13T18:54:21.315Z","extensionVersion":"v3.4.3"}
@ortuagustin
ortuagustin / cloudSettings
Created April 22, 2019 15:12
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-04-22T15:10:56.813Z","extensionVersion":"v3.2.8"}
@ortuagustin
ortuagustin / Enum.Wrapper.pas
Created December 26, 2017 22:06
Enum.Wrapper.pas
unit Enum.Wrapper;
interface
uses
System.SysUtils,
System.TypInfo;
type
EEnumOutOfRange = class(System.SysUtils.EArgumentOutOfRangeException);
unit DateTimeHelper.Exceptions;
interface
uses
System.SysUtils;
type
{$REGION 'Exceptions'}
/// <summary> Ancestro base para todas las excepciones elevadas por TDateTimeHelper </summary>
unit DateTimeHelper;
interface
uses
DateTimeHelper.Exceptions,
System.Types,
System.SysUtils,
System.DateUtils;
@ortuagustin
ortuagustin / Test003.dpr
Created January 7, 2017 04:58 — forked from xcluster/Test003.dpr
Delphi / TFormAsInterface
program Test003;
uses
FastMM4 in '..\..\..\VCL\FastMM4\FastMM4.pas',
FastMM4Messages in '..\..\..\VCL\FastMM4\FastMM4Messages.pas',
Vcl.Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2},
Unit3 in 'Unit3.pas';
TSomeClass = class
strict private type
IStrictPrivate = interface
['{4FBB71DA-2E34-470E-8A22-1DB3F7716252}']
end;
strict protected type
IStrictProtected = interface
['{14D38867-7A34-4556-BEBB-CF709FBBA6BC}']
end;
private type
IFoo = interface
['{4061C455-B122-48D6-940F-9C1B2FD4A689}']
end;
IDoesntWorkFactory = interface
['{E9A093ED-C429-46C3-82DD-D5D32EB9120F}']
function Create(const Blabla: string): IFoo; overload;
function Create(const Blabla: Integer): IFoo; overload;
end;
@ortuagustin
ortuagustin / SingletonService.pas
Last active November 29, 2016 22:00
SingletonService
unit Service;
type
IService = interface
procedure DoServiceThing;
end;
TFactory<T> = reference to function: T;
unit ServiceImpl;