Skip to content

Instantly share code, notes, and snippets.

View manualbashing's full-sized avatar
:shipit:

Manuel Batsching manualbashing

:shipit:
View GitHub Profile
@manualbashing
manualbashing / day8.ps1
Created December 8, 2023 22:23
AoC Day8
function Import-PuzzleInput {
param (
$Path
)
$instructions, $null, $puzzleInput = Get-Content $Path
$nodes = @{}
$puzzleInput |
ForEach-Object {
$null = $_ -match '^(.{3}) = \((.{3}), (.{3})\)$'
$nodes[$Matches[1]] = [PSCustomObject]@{
@manualbashing
manualbashing / day7.ps1
Created December 8, 2023 21:17
AoC Day 7
function Import-PuzzleInput {
param (
$Path
)
$puzzleInput = Get-Content $Path
$puzzleInput | ForEach-Object {
$hand, $bid = $_ -split ' '
[PSCustomObject]@{
Hand = $hand
Bid = $bid
function Import-PuzzleInput {
param (
$Path
)
$puzzleInput = Get-Content $Path
$puzzleInput -replace '.*:' | ForEach-Object {
$scratchCardNumbers, $null, $numbersYouHave = $_ -replace ' +', ' ' -split '( \| )'
$scratchCardNumbers = $scratchCardNumbers -split ' '
$numbersYouHave = $numbersYouHave -split ' '

👉 Hier klicken, um direkt zur Anleitung zu springen 👈

Warum noch eine Kommunikationsplattform?

Es gibt auch zwischen den regelmäßig stattfindenden Zoom-Meetings Gründe, miteinander zu kommunizieren. Das könnten Fragen oder interessante Aufsätze, Web-Ressourcen oder auch Ideen und Verständnisfragen sein.

Natürlich könnte man sich jetzt einfach über den E-Mail-Verteiler austauschen, aber das wird schnell unübersichtlich und führt zu noch mehr Rauschen im oft schon überfüllten E-Mail-Postfach. Auch der Austausch über gemeinsam bearbeitbare Dokumente wie Google Docs ist eher umständlich und unübersichtlich.

Eine gute Alternative zu E-Mail und gemeinsam editierbaren Dokumenten wäre es, über eine dedizierte Kommunikationsplattform einen Raum zu schaffen, in dem über die Themen der DGPhil kommuniziert werden kann. User entscheiden dann selbst, wann und ob sie Zeit und Lust haben am Diskurs teilzunehmen.

@manualbashing
manualbashing / New-DeterministicGuid.ps1
Last active June 12, 2023 14:12
Create deterministric GUID from string
function New-DeterministicGuid {
param
(
[String] $InputObject
)
$Hash = New-Object System.Text.StringBuilder
$([System.Security.Cryptography.HashAlgorithm]::Create('MD5')).ComputeHash([System.Text.Encoding]::UTF8.GetBytes($InputObject)) |
ForEach-Object {
function Set-PublicIpAzSqlFirewallRule {
[CmdletBinding()]
param (
# Name of the SQL server
[Parameter(Mandatory)]
[string]
$ServerName,
# Name of the SQL server's resource group
[Parameter(Mandatory)]
@manualbashing
manualbashing / chunk-logicApp.json
Created March 17, 2023 11:28
Use chunk expression function in Logic Apps
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Compose": {
"inputs": "@chunk(variables('sourceArray'), 3)",
"runAfter": {
"Initialize_variable_-_sourceArray": [
"Succeeded"
]
@manualbashing
manualbashing / Export-SentinelWatchlist.ps1
Last active March 10, 2023 11:38
Export-SentinelWatchlist
function Export-SentinelWatchlist {
[CmdletBinding()]
param (
# Id of the subscription in which the sentinel workspace is located
[Parameter()]
[string]
$SubscriptionId = (Get-AzContext).Subscription.Id,
# Name of the resourec group in which the sentinel workspace is located
[Parameter(Mandatory)]
@manualbashing
manualbashing / read.html
Last active November 15, 2022 11:38
Goodreads widget
<!-- Show static HTML/CSS as a placeholder in case js is not enabled - javascript include will override this if things work -->
<style type="text/css" media="screen">
.gr_custom_container_1668510558 {
/* customize your Goodreads widget container here*/
border: 1px solid gray;
border-radius:10px;
padding: 10px 5px 10px 5px;
background-color: #FFFFFF;
color: #000000;
width: 350px;
if (!pm.collectionVariables.get("bearerToken") || Date.now() > new Date(pm.collectionVariables.get("bearerTokenExpiresOn") * 1000)) {
pm.sendRequest({
url: 'https://login.microsoftonline.com/' + pm.collectionVariables.get("tenantId") + '/oauth2/token',
method: 'POST',
header: 'Content-Type: application/x-www-form-urlencoded',
body: {
mode: 'urlencoded',
urlencoded: [
{ key: "grant_type", value: "client_credentials", disabled: false },
{ key: "client_id", value: pm.collectionVariables.get("clientId"), disabled: false },