Skip to content

Instantly share code, notes, and snippets.

@ortuagustin
ortuagustin / FMX.Layout.Constraint.pas
Created August 21, 2016 23:29
Firemonkey constraint
// Source: http://delphiaccess.com/foros/index.php/topic/12206-alguien-conoce-algo-análogo-a-constraint-de-vcl/
// Author: @genriquez
unit FMX.Layout.Constraint;
type
TLayout = class(FMX.Layouts.TLayout)
private
FConstraint: TPoint;
procedure SetConstraint(const Value: TPoint);
@ortuagustin
ortuagustin / ClassRtti.dpr
Last active November 27, 2016 00:48
ClassRtti
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
System.Rtti;
@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;
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;
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
@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';
unit DateTimeHelper;
interface
uses
DateTimeHelper.Exceptions,
System.Types,
System.SysUtils,
System.DateUtils;
unit DateTimeHelper.Exceptions;
interface
uses
System.SysUtils;
type
{$REGION 'Exceptions'}
/// <summary> Ancestro base para todas las excepciones elevadas por TDateTimeHelper </summary>
@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);
@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"}