Skip to content

Instantly share code, notes, and snippets.

View ststeiger's full-sized avatar
😎
Back from holidays

Stefan Steiger ststeiger

😎
Back from holidays
  • Switzerland
View GitHub Profile
@ststeiger
ststeiger / NormalForms.txt
Created April 11, 2025 15:41
SQL Normal Forms
https://www.perplexity.ai/search/can-you-find-me-information-re-Kv6Kcel1R..clYeGhwa6xg
OK, so to put this down to the Level of an intelligent 12year old:
First normal form is violated if
A) cells have multiple values inside the same cell (e.g. separated by separator)
or
B) there are repeating columns for the same thing, e.g. Tel1, Tel2, Tel3,
@ststeiger
ststeiger / NetCoreIIS_Tutorial.md
Last active March 1, 2025 19:00
Tutorial - install asp.net core application in IIS
@ststeiger
ststeiger / JsonType.sql
Last active December 13, 2024 15:38
Determine the type of a JSON-object in MSSQL
;WITH CTE AS
(
SELECT NULL AS CLV_Value
UNION ALL SELECT '123' AS CLV_Value
UNION ALL SELECT '[1,2,3]' AS CLV_Value
UNION ALL SELECT '{"0": 1234}'
UNION ALL SELECT '{
"json": "[]",
"svg": null,
@ststeiger
ststeiger / pgsql.cmd
Last active October 14, 2024 17:48
Batch-start PostGreSQL on Windows
@echo off
title PostgreSQL Portable
cls
:: set default code page
chcp 1252 > nul
:: initialise a new database on first use
if not exist "%PGDATA%" (
echo.
@ststeiger
ststeiger / Find_MultiValue_FKs.sql
Created September 24, 2024 11:56
Find multi-column foreign-keys in MSSQL
SELECT
sch.name AS table_schema
,tp.name AS table_name
,schFK.name AS fk_schema
,fk.name AS fk_name
,STUFF
(
(
SELECT ', ' + c.name
@ststeiger
ststeiger / CollationInfo.sql
Created September 20, 2024 15:12
Show info about collation
SELECT
-- name
DISTINCT collation_name
FROM sys.databases
WHERE (1=1)
-- AND name = 'tempdb';
SELECT name, collation_name
FROM sys.databases
WHERE (1=1)
@ststeiger
ststeiger / Task_Promise_Equivalent.cs
Created September 9, 2024 17:06
Syntax Comparison Promises with C# and JavaScript
namespace BaristaLabs.SkinnyHtml2Pdf.Web
{
/*
function waitForEvent()
{
return new Promise((resolve, reject) =>
{
@ststeiger
ststeiger / computed_columns_dependencies.sql
Created August 22, 2024 12:01
Figure out which computed column depends on which column
SELECT
cc.schema_name
,cc.table_name
,cc.computed_column_name
,dc.name AS dependent_column_name
,fk.REFERENCED_TABLE_SCHEMA AS referenced_table_schema
,fk.REFERENCED_TABLE_NAME AS referenced_table_name
,fk.REFERENCED_COLUMN_NAME AS referenced_column_name
@ststeiger
ststeiger / await_worker_request.htm
Last active August 20, 2024 16:19
Awaiting a worker request in JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<title>Awaiting Worker Request</title>
@ststeiger
ststeiger / uuid.txt
Last active August 20, 2024 14:08
How to generate GUID/uuid-V4 in different programming languages
// .NET
System.Guid.NewGuid().ToString()
// JS:
function generateUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);