Skip to content

Instantly share code, notes, and snippets.

View SBajonczak's full-sized avatar
🍇

Sascha Bajonczak SBajonczak

🍇
View GitHub Profile
<div class="section-block section-price hidden">
<h3 class="section-block--header tds-text--item_headline">Car Price</h3>
<p class="section-block--data tds-text--body">$76,900</p>
</div>
@SBajonczak
SBajonczak / HTTP3.js
Created March 19, 2023 08:37
Making http3 call
fetch('https://example.com/api', {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
protocol: 'http3',
})
.then(response => {
if (!response.ok) {
@SBajonczak
SBajonczak / HTTP3.cs
Created March 19, 2023 08:24
HTTP3 ASP.net Core example
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpsRedirection(options =>
{
options.HttpsPort = 443;
});
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
@SBajonczak
SBajonczak / captivePortalExample.ino
Created November 28, 2022 19:16
Captive Portal
#include <DNSServer.h>
#include <WiFi.h>
#include <AsyncTCP.h>
#include "ESPAsyncWebServer.h"
DNSServer dnsServer;
AsyncWebServer server(80);
String user_name;
String proficiency;
@SBajonczak
SBajonczak / TicketReport.ps1
Created May 5, 2022 10:59
Get a report for TIcket work duration from azure devops
# Set the Selection Parameters here!!!!
$yearToSelect=2022
# PAT Generation documented here: https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows#create-a-pat
# Required Permissions: Analytics (READ):; Work Items (READ)
$AzureDevOpsPAT = "PLEASE INSERT PAT"
$OrganizationName = "realcoretfs"
$AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($AzureDevOpsPAT)")) }
$AzureDevOpsAuthenicationHeader
@SBajonczak
SBajonczak / City.cs
Created January 5, 2022 19:21
City with Geolocation capatibilities
using NetTopologySuite.Geometries;
using System.ComponentModel.DataAnnotations.Schema;
namespace spatial
{
[Table("City")]
public class City
{
public int ID { get; set; }
@SBajonczak
SBajonczak / Query Nearest City.cs
Created January 4, 2022 20:33
Query Spatial the nearest city
// 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
SBajonczak / demodata.cs
Created January 4, 2022 20:19
Creating Spatial Demo Data
// Create first data entry
City seattle = new City();
seattle.CityName = "Seattle";
seattle.Location = new Point(-122.333056, 47.609722) { SRID = 4326 };
ctx.Cities.Add(seattle);
// Create second data entry
City redmond = new City();
redmond.CityName = "Redmond";
redmond.Location = new Point(-122.123889, 47.669444) { SRID = 4326 };
@SBajonczak
SBajonczak / ImportGroupsToAzureAD.ps1
Created January 3, 2022 19:33
Importing Groups from an array into the Azure AD
foreach ($group in $groups)
{
$name = $group.Name
$owner = $group.Owner
$foundElement = get-azureadgroup -SearchString $name
if ($foundElement)
{
Write host "$name already exists"
} else
@SBajonczak
SBajonczak / openNuki.js
Created January 2, 2022 19:22
Nuki Script for Opening the deoor after 5 Seconds
on('buttons.default.switch.desktop' _=>{
setTimeout(_=>{
setState('nuki.0.1234567890.actions.openAction',true);
},5000); // Wait 5 seconds
})