Skip to content

Instantly share code, notes, and snippets.

@Al-Muhandis
Al-Muhandis / configuration.pas
Last active Jul 17, 2021
Saving an object in JSON and loading it from it
View configuration.pas
// ... ... ...
uses fpjson, jsonscanner, fpjsonrtti
;
// ... ... ...
procedure LoadFromJSON(AObject: TObject; const AFileName: String);
var
ADeStreamer: TJSONDeStreamer;
@Al-Muhandis
Al-Muhandis / project1.pas
Last active Sep 9, 2021
Compressing and decompressing. String input and output
View project1.pas
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
@Al-Muhandis
Al-Muhandis / zip_odt.pas
Created Sep 25, 2021
Example demonstrating filling out the odt documents files using the native FPC paszlib library
View zip_odt.pas
unit zip_odt;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils;
procedure FillODTDoc(const aSrcFile, aDestFile: String; aKeyValuePairs: TStringList);
@Al-Muhandis
Al-Muhandis / your_site.conf
Created Apr 29, 2018
Настройка nginx для проксирования telegram серверов
View your_site.conf
#user 'sampleuser' virtual host 'telegramapi.sample.com' configuration file
server {
server_name telegramapi.sample.com www.telegramapi.sample.com;
... ... ...
location / {
proxy_set_header Host api.telegram.org;
proxy_pass https://api.telegram.org;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@Al-Muhandis
Al-Muhandis / odt_2_pdf.pas
Created Aug 4, 2022
simple method to export from odt/doc to pdf
View odt_2_pdf.pas
unit odt_2_pdf;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils;
function ConvertODT2Pdf(const aSrcODT, aOutDir: String): Boolean;