Skip to content

Instantly share code, notes, and snippets.

View viniciusfbb's full-sized avatar

Vinícius Felipe Botelho Barbosa viniciusfbb

View GitHub Profile
@viniciusfbb
viniciusfbb / DeviceModel.iOS.pas
Last active January 21, 2024 20:03
Get the device model name in iOS in Delphi (Firemonkey) applications
unit DeviceModel.iOS;
interface
function GetDeviceModelName: string;
function GetDeviceModelPrettyName: string;
implementation
uses
@jimmckeeth
jimmckeeth / SetupUbuntu4Delphi22.sh
Last active June 16, 2024 09:33
This script automates the setup of Ubuntu 22.04 LTS for Delphi 11.3 Alexandria
#!/bin/bash
#
# Download and execute with the following:
# curl -L https://embt.co/SetupUbuntu4Delphi22 | bash
#
echo "Updating the local package directory"
sudo apt update
echo "Upgrading any outdated pacakges"
sudo apt full-upgrade -y
echo "Install new packages necessary for Delphi & FMXLinux"
@njsmith
njsmith / ucrt-csv.py
Last active March 26, 2025 22:16
Information on linking to the new Windows UCRT
import sys
import subprocess
import csv
def describe_ucrt_lib(platform):
lib_path = "windows-10-sdk/Lib/10.0.10240.0/ucrt/{}/ucrt.lib".format(platform)
output = subprocess.check_output(["nm", lib_path])
output = output.decode("utf-8")
# Output (x86 32-bit) looks like:
@avanderw
avanderw / image-grayscale
Last active February 22, 2024 06:15
The following color matrix filter will grayscale an image.
private const matrix:Array = [
0.3, 0.59, 0.11, 0, 0,
0.3, 0.59, 0.11, 0, 0,
0.3, 0.59, 0.11, 0, 0,
0, 0, 0, 1, 0];
private const zero:Point = new Point();
grayscale.bitmapData.applyFilter(image.bitmapData, image.getRect(image), zero, new ColorMatrixFilter(matrix));