Skip to content

Instantly share code, notes, and snippets.

View Tomamais's full-sized avatar

Tomás Tomamais

View GitHub Profile
@Tomamais
Tomamais / checkUrlsInEdge.bas
Created January 30, 2026 19:00
VBA script to automate checks using Edge
Option Explicit
' Windows API for screenshots and window handling
Private Declare PtrSafe Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As LongPtr)
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub AutomateAppCheck()
Dim ws As Worksheet
Dim lastRow As Long, i As Long
Dim url As String, user As String, pass As String
# 1. Configuration
$jsonInputPath = "C:\path\to\your\input.json"
$outputPath = "C:\path\to\your\output.txt"
# 2. Function to recursively flatten objects and arrays
function Flatten-JsonObject ($Object, $Prefix = "") {
$results = [ordered]@{}
foreach ($property in $Object.PSObject.Properties) {
# Construct the base key name (e.g., Person.Children)
<#
.SYNOPSIS
Reads a tab-separated .NET Core log file, displays it in a custom Windows Forms DataGridView,
and provides a refresh button. Rows are color-coded based on the LogLevel.
.NOTES
This script requires a Windows OS environment to load the System.Windows.Forms and System.Drawing assemblies.
#>
param(
[Parameter(Mandatory=$true)]
<#
.SYNOPSIS
Reads, parses, and displays a tab-separated log file in a filterable grid view,
ordered by the most recent log entries.
#>
param(
[Parameter(Mandatory=$true)]
[string]$LogFilePath
)
-- Enable OLE Automation Procedures if not already enabled.
-- This is a server-wide setting and has security implications.
-- EXEC sp_configure 'Ole Automation Procedures', 1;
-- RECONFIGURE;
-- GO
-- Declare variables for the HTTP request
DECLARE @url VARCHAR(255) = 'http://www.dneonline.com/calculator.asmx'; -- Example SOAP service URL
DECLARE @soapAction VARCHAR(255) = 'http://tempuri.org/Add'; -- The SOAPAction header for the method
DECLARE @xmlPayload NVARCHAR(MAX); -- The XML payload for the SOAP request
using System;
using Oracle.ManagedDataAccess.Client;
using OfficeOpenXml;
using System.IO;
namespace OracleConnectionExample
{
class Program
{
static void Main(string[] args)
Sub ConnectToOracle()
Dim conn As Object
Dim cmd As Object
Dim rs As Object
Dim connString As String
Dim sqlQuery As String
Dim paramValue As String
' Set connection string
connString = "Provider=MSDAORA;Data Source=YourOracleDB;User ID=YourUsername;Password=YourPassword;"
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
class DatabaseSyncApp
{
static string sourceConnectionString = "your_source_connection_string";
static string destinationConnectionString = "your_destination_connection_string";
Function FuzzyPercent(ByVal String1 As String, _
ByVal String2 As String, _
Optional Algorithm As Integer = 3, _
Optional Normalised As Boolean = False) As Single
'*************************************
'** Return a % match on two strings **
'*************************************
Dim intLen1 As Integer, intLen2 As Integer
Dim intCurLen As Integer
Dim intTo As Integer
CREATE FUNCTION dbo.FuzzyPercent
(
@String1 NVARCHAR(MAX),
@String2 NVARCHAR(MAX),
@Algorithm INT = 3,
@Normalised BIT = 0
)
RETURNS FLOAT
AS
BEGIN