Skip to content

Instantly share code, notes, and snippets.

View tondrej's full-sized avatar

Ondrej Kelle tondrej

View GitHub Profile
unit Data.Win.OleDbUtils;
interface
uses
System.Classes,
System.SysUtils,
System.Win.ComObj,
Winapi.Windows,
Winapi.ActiveX,
@tondrej
tondrej / ADORecordSet.pas
Last active July 12, 2020 10:56
A very crude ADO RecordSet wrapper for a TDataSet with basic navigation
unit ADORecordSet;
interface
uses
Winapi.Windows, Winapi.ActiveX, Winapi.ADOInt,
System.Classes, System.SysUtils, System.Win.ComObj, System.Variants,
Data.DB;
type

Keybase proof

I hereby claim:

  • I am tondrej on github.
  • I am tondrej (https://keybase.io/tondrej) on keybase.
  • I have a public key whose fingerprint is BF32 CE19 32B2 61E8 8F2F F6CD 9D6B 32D2 2E82 F39D

To claim this, I am signing this object:

@tondrej
tondrej / backlit.sh
Last active February 26, 2018 04:04
Clevo backlit keyboard
#!/bin/bash
BLACK=000
BLUE=001
RED=010
MAGENTA=011
GREEN=100
AQUA=101
YELLOW=110
WHITE=111
Index: JwaWinPerf.pas
===================================================================
--- JwaWinPerf.pas (revision 1115)
+++ JwaWinPerf.pas (working copy)
@@ -171,13 +171,21 @@
// counter definition for this
// object
ObjectNameTitleIndex: DWORD; // Index to name in Title Database
+{$ifdef WIN64}
+ ObjectNameTitle: DWORD; // Should use this as an offset
@tondrej
tondrej / pre-commit
Last active April 25, 2017 17:41
Git pre-commit hook to convert Delphi's *.dfm files from binary to text
#!/bin/sh
# Check *.dfm files being committed for binary format, if so convert to text automatically.
for s in $(git diff --cached --name-only *.dfm); do
grep -qI '' $s
if [ $? = 1 ]; then
echo Converting $s from binary to text
convert -i -t $s > /dev/null
git add $s
fi
@tondrej
tondrej / ChakraCoreHostMainData.pas
Created January 6, 2018 13:50
chakracore-delphi preview
// example usage...
procedure TDataModuleMain.DataModuleCreate(Sender: TObject);
begin
try
FRuntime := TChakraCoreRuntime.Create([ccroEnableExperimentalFeatures, ccroDispatchSetExceptionsToDebugger]);
FContext := TChakraCoreContext.Create(FRuntime);
FContext.Activate;
ChakraCoreCheck(JsCreateObject(FConsole));
ChakraCoreCheck(JsAddRef(FConsole, nil));
SetCallback(FConsole, 'assert', ConsoleAssertFunc, Self);
@tondrej
tondrej / README.md
Created January 12, 2018 17:07
chakracore-delphi initial release

chakracore-delphi

Delphi and Free Pascal bindings and classes for Microsoft's ChakraCore library.

ChakraCore version: 1.7.6

Supported compilers:

  • Delphi 7 or newer
  • Free Pascal 3.0.4 or newer

Supported target platforms:

@tondrej
tondrej / qt5.patch
Last active April 2, 2018 08:00
Patch for Lazarus 1.8.2 Qt5 interface bindings to compile with Visual Studio 2015
Index: pascalbind.h
===================================================================
--- pascalbind.h (revision 57427)
+++ pascalbind.h (working copy)
@@ -27,13 +27,13 @@
#include "chandles.h"
-#if defined(__WIN32__)
+#if defined(__WIN32__) || defined(_WIN32)
@tondrej
tondrej / unit1.pas
Last active April 1, 2018 13:55
Lazarus Qt5 test project
unit Unit1;
{$mode objfpc}{$H+}
{$macro on}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls;