Skip to content

Instantly share code, notes, and snippets.

View svanas's full-sized avatar

Stefan svanas

View GitHub Profile
@svanas
svanas / tortoise-git-for-bitbucket-and-github-for-windows.md
Last active August 16, 2020 03:55
TortoiseGit for Bitbucket and GitHub for Windows
{******************************************************************************}
{* ISecureString *}
{* *}
{* Created by Stefan van As <[email protected]> *}
{* *}
{* DISCLAIMER *}
{* *}
{* This software is provided 'as is' with no explicit or implied warranties *}
{* in respect of its properties, including, but not limited to, correctness *}
{* and/or fitness for purpose. *}

Keybase proof

I hereby claim:

  • I am svanas on github.
  • I am svanas (https://keybase.io/svanas) on keybase.
  • I have a public key whose fingerprint is F070 21A3 D946 95EB 4DB6 67C5 4978 0088 FF9F 3627

To claim this, I am signing this object:

@svanas
svanas / com.google.chrome.example.echo.dpr
Created August 11, 2016 09:48
Chrome Native Messaging Example
program com.google.chrome.example.echo;
{$APPTYPE CONSOLE}
uses
WinAPI.Windows,
System.Classes,
System.SysUtils,
System.JSON;
@svanas
svanas / bpl.reg
Created May 31, 2017 08:56
Windows Explorer version info property sheet for BPLs
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers\.bpl]
@="{66742402-F9B9-11D1-A202-0000F81FEDEE}"
@svanas
svanas / ETH-XXX.sh
Last active April 16, 2021 20:26
Use the Nefertiti crypto bot and trade on all the ETH-XXX market pairs with a single click.
# Trade on all the ETH-XXX market pairs.
# Written by Stefan van As <svanas AT runbox DOT com>
# Example: ./ETH-XXX.sh --exchange=Bittrex --price=0.05 --api-key=X --api-secret=X --pushover-app-key=X --pushover-user-key=X
for i in "$@"
do
case $i in
--exchange=*)
EXCHANGE="${i#*=}"
shift # past argument=value
@svanas
svanas / Unit1.pas
Last active May 8, 2023 14:38
Get balance of Ethereum wallet from Delphi
web3.eth.getBalance(TWeb3.Create(Ganache), Edit1.Text, procedure(qty: BigInteger; err: IError)
begin
TThread.Synchronize(nil, procedure
begin
if Assigned(err) then
MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0)
else
ShowMessage(web3.eth.utils.fromWei(qty, web3.eth.utils.ether) + ' ether');
end);
end);
@svanas
svanas / Unit1.pas
Last active June 4, 2024 16:55
Get the totalSupply() of a token (that is not ether) on the Ethereum blockchain
const Client: IWeb3 = TWeb3.Create('https://mainnet.infura.io/v3/your-project-id');
web3.eth.call(Client, '0xB8c77482e45F1F44dE1745F52C74426C631bDD52', 'symbol()', [], procedure(tup: TTuple; err: IError)
begin
if Assigned(err) then
begin
TThread.Synchronize(nil, procedure
begin
MessageDlg(err.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0)
end);
EXIT;
@svanas
svanas / Unit1.pas
Last active May 31, 2023 17:36
Generating an Ethereum-signed message signature in Delphi
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(
web3.eth.crypto.sign(
TPrivateKey('b5b1870957d373ef0eeffecc6e4812c0fd08f554b37b233526acc331bf1544f7'),
'Hello, World!'
).ToHex
);
end;
@svanas
svanas / Unit1.pas
Last active May 31, 2023 17:34
Transferring Ether with Delphi
web3.eth.tx.sendTransaction(
TWeb3.Create(Ganache), // Ganache 2.7.1
TPrivateKey('24622d680bb9d6d80c4d3fb4b4818e738de64b521948b1b1c85616eeeda54ee1'), // from private key
'0xaDDcedc01C1070bCE0aF7eb853845e7811EB649C', // to public key
web3.eth.utils.toWei('0.01', ether).Value, // 0.01 ether
procedure(tx: TTxHash; err: IError)
begin
TThread.Synchronize(nil, procedure
begin
if Assigned(err) then