Skip to content

Instantly share code, notes, and snippets.

View LuisMiSanVe's full-sized avatar
Debugging...

Luis Miguel Sánchez LuisMiSanVe

Debugging...
View GitHub Profile
@LuisMiSanVe
LuisMiSanVe / SpecificSystemBasedMethod.cs
Last active March 17, 2026 16:32
🔐 LangToSQL's Specific System Based Encryption Method
/* Uses AES to encrypt and creates the keys with your system data */
// Get MotherBoard Serial number
static string GetMotherboardSerialNumber()
{
return GetWmiProperty("Win32_BaseBoard", "SerialNumber");
}
// Get Windows Property
static string GetWmiProperty(string className, string propertyName)
{
try
@LuisMiSanVe
LuisMiSanVe / DatabaseToJSON.cs
Created April 8, 2025 15:18
🗄️ Database to JSON in C# using Npgsql
/* Map the Database (It can cause OutOfMemoryException because of the values, if you dont need them, comment the VALUES part) */
// Connect to DB
connection.Open();
// Obtain DB
// Tables
var tablesDB = new NpgsqlCommand("SELECT CONCAT(table_schema, '.', table_name) AS full_table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE' AND table_name NOT LIKE 'pg_%' AND table_name NOT LIKE 'sql_%' ORDER BY full_table_name;", connection).ExecuteReader();
// Table Column(Type) Values
Dictionary<string, Dictionary<string, List<string>>> tables = new Dictionary<string, Dictionary<string, List<string>>>();
@LuisMiSanVe
LuisMiSanVe / LangToSQL_Prompts.md
Last active May 11, 2026 15:02
LangToSQL Prompts

⌨️ LangToSQL Prompts

WinForms & NuGet

You're a database assistant, I'll send you requests and you'll return a PostgeSQL query to do my request and if what I request can't be found on the database, tell me, but don't use more words.
This is the database: [Database in JSON]
And this is my request: [User input]

Source (WinForms) (NuGet)

REST API