Skip to content

Instantly share code, notes, and snippets.


Sascha Bajonczak SBajonczak

View GitHub Profile
View captivePortalExample.ino
#include <DNSServer.h>
#include <WiFi.h>
#include <AsyncTCP.h>
#include "ESPAsyncWebServer.h"
DNSServer dnsServer;
AsyncWebServer server(80);
String user_name;
String proficiency;
SBajonczak / TicketReport.ps1
Created May 5, 2022
Get a report for TIcket work duration from azure devops
View TicketReport.ps1
# Set the Selection Parameters here!!!!
# PAT Generation documented here:
# Required Permissions: Analytics (READ):; Work Items (READ)
$OrganizationName = "realcoretfs"
$AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($AzureDevOpsPAT)")) }
SBajonczak / City.cs
Created Jan 5, 2022
City with Geolocation capatibilities
View City.cs
using NetTopologySuite.Geometries;
using System.ComponentModel.DataAnnotations.Schema;
namespace spatial
public class City
public int ID { get; set; }
SBajonczak / Query Nearest City.cs
Created Jan 4, 2022
Query Spatial the nearest city
View Query Nearest City.cs
// Create factory
var gf = NetTopologySuite.NtsGeometryServices.Instance.CreateGeometryFactory(4326);
// Set our Current Location
var currentLocation = gf.CreatePoint(new NetTopologySuite.Geometries.Coordinate(-122.171936, 47.643159));
// Find the nearest city in correlation to our location
var nearestCity = ctx.Cities.OrderBy(c => c.Location.Distance(gf.CreateGeometry(currentLocation)));
// Print out
Console.WriteLine(String.Format("Nearest Citiy is : {0}", nearestCity.ToList().FirstOrDefault().CityName));
SBajonczak / demodata.cs
Created Jan 4, 2022
Creating Spatial Demo Data
View demodata.cs
// Create first data entry
City seattle = new City();
seattle.CityName = "Seattle";
seattle.Location = new Point(-122.333056, 47.609722) { SRID = 4326 };
// Create second data entry
City redmond = new City();
redmond.CityName = "Redmond";
redmond.Location = new Point(-122.123889, 47.669444) { SRID = 4326 };
SBajonczak / ImportGroupsToAzureAD.ps1
Created Jan 3, 2022
Importing Groups from an array into the Azure AD
View ImportGroupsToAzureAD.ps1
foreach ($group in $groups)
$name = $group.Name
$owner = $group.Owner
$foundElement = get-azureadgroup -SearchString $name
if ($foundElement)
Write host "$name already exists"
} else
SBajonczak / openNuki.js
Created Jan 2, 2022
Nuki Script for Opening the deoor after 5 Seconds
View openNuki.js
on('buttons.default.switch.desktop' _=>{
},5000); // Wait 5 seconds
SBajonczak / checkPermission.cs
Created Dec 28, 2021
Generate Bitmask Check
View checkPermission.cs
public bool HasAccessTo(int profileValue, ApplicationRole roleToCheck){
return (profileValue & roleToCheck) === roleToCheck
// Will result true
bool result= HasAccesTo(21,ApplicationRole.Contributor);
// Will result false
bool result= HasAccesTo(21,ApplicationRole.Administrator);
SBajonczak / BItmaskEnum.cs
Last active Dec 27, 2021
BistmaskEnumeration Definitions
View BItmaskEnum.cs
public enum ApplicationRole
SBajonczak /
Created Dec 27, 2021
Differences between Clustered Index and NonClustered Index
Parameters Clustered Non-clustered
Use for You can sort the records and store clustered index physically in memory as per the order. A non-clustered index helps you to creates a logical order for data rows and uses pointers for physical data files.
Storing method Allows you to stores data pages in the leaf nodes of the index. This indexing method never stores data pages in the leaf nodes of the index.
Size The size of the clustered index is quite large. The size of the non-clustered index is small compared to the clustered index.
Data accessing Faster Slower compared to the clustered index
Additional disk space Not Required Required to store the index separately
Type of key By Default Primary Keys Of The Table is a Clustered Index. It can be used with unique constraint on the table which acts as a composite key.
Main feature A clustered index can improve the performance of data retrieval. It should be created on columns which are used in joins.