Skip to content

Instantly share code, notes, and snippets.

@fluisgirardi
fluisgirardi / ThreadMsg.pas
Last active October 2, 2021 15:10
This example shows how save a bitmap in a memory stream and how to safe pass it to another thread without use locking techniques.
procedure YourClass.SaveBMP;
var
ms:TMemoryStream;
begin
//your code
ms:=TMemoryStream.Create;
yourBMP.SaveToStream(ms); //instead of save to file
yourThreadInstance.SendBMPStream(ms);
end;
@CynicRus
CynicRus / .pas
Last active August 6, 2021 13:15
get windows key
const
CharMap: array [0..23] of char = 'BCDFGHJKMPQRTVWXY2346789';
var
ProductID: array of byte;
IdPart: array [0..14] of byte;
Registry: TRegistry;
DataSize: integer;
Key: ansistring;
i, j, c: integer;
begin
@CynicRus
CynicRus / gist:8f5d213d16c9b9eb75ef13dbd9bfa273
Created October 23, 2020 09:44
Golang tokenizer on Freepascal
unit utokenizer;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
const
@xameeramir
xameeramir / default nginx configuration file
Last active May 4, 2024 17:27
The default nginx configuration file inside /etc/nginx/sites-available/default
# Author: Zameer Ansari
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#