Skip to content

Instantly share code, notes, and snippets.

View robinmanuelthiel's full-sized avatar
✌️
Never grow up!

Robin-Manuel Thiel robinmanuelthiel

✌️
Never grow up!
View GitHub Profile
@robinmanuelthiel
robinmanuelthiel / update.yaml
Created September 14, 2021 15:30
GitHub Action to update and publish Docusaurus Docs to GitHub Pages
name: Update documentaion
on:
workflow_dispatch:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
export default class CrytoHelpers {
static generateRandomString(): string {
var array = new Uint32Array(64);
window.crypto.getRandomValues(array);
return Array.from(array, dec => ('0' + dec.toString(16)).substr(-2)).join('');
}
static async pkceChallengeFromVerifierAsync(v: string): Promise<string> {
const hashed = await this.sha256(v);
return this.base64urlencode(hashed);
@robinmanuelthiel
robinmanuelthiel / aadpodidentity-keyvault-demo.tf
Last active August 16, 2022 05:43
Terraform Setup AAD Pod Identity in AKS clusters with Managed Identity
# Azure Key Vault for Testing Access
resource "azurerm_key_vault" "default" {
name = "rothietftestvault"
location = azurerm_resource_group.default.location
resource_group_name = azurerm_resource_group.default.name
tenant_id = data.azurerm_client_config.current.tenant_id
sku_name = "standard"
}
# Azure Key Vault Access Policy for Managed Identity for yourself
# Requirements
# - Homebrew: https://brew.sh
tap "azure/functions"
tap "caskroom/cask"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
# Essentials
import RPi.GPIO as GPIO
from time import sleep
from RpiMotorLib import RpiMotorLib
from multiprocessing import Process
def rotateMotor(motor, pins, isClockwise):
motor.motor_run(pins, .001, 128, isClockwise, False, "half", .05);
def open(motorLeft, pinsLeft, motorRight, PinsRight):
leftMotorProcess = Process(target=rotateMotor,args=(motorLeft,pinsleft,False,));
#######################################################
# Step 1: Build the application in a container #
#######################################################
# Download the official ASP.NET Core SDK image
# to build the project while creating the docker image
FROM microsoft/dotnet:2.1-sdk as build
WORKDIR /app
# Restore NuGet packages
@robinmanuelthiel
robinmanuelthiel / azuredevops-editorconfig.yaml
Last active April 3, 2020 20:40
EditorConfig Check with Azure DevOps
pool:
vmImage: 'Ubuntu 16.04'
steps:
- bash: |
npm install -g eclint
eclint check eclint check $(git ls-files)
failOnStderr: true
displayName: 'Check EditorConfig violations'
@robinmanuelthiel
robinmanuelthiel / webappforcontainer.tf
Last active November 12, 2019 17:21
The Terraform documentation is missing dedicated configuration details for containers on App Services. Here is, how it's done. https://pumpingco.de/blog/14472/
# Use the Azure Resource Manager Provider
provider "azurerm" {
version = "~> 1.15"
}
# Create a new Resource Group
resource "azurerm_resource_group" "group" {
name = "pumpingcode-webapp-containers-demo"
location = "northeurope"
}
@robinmanuelthiel
robinmanuelthiel / MainPage.xaml
Created February 16, 2017 14:36
Custom Xamarin.Forms Menu Item
<?xml version="1.0" encoding="utf-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:ZeissCantinaMenuSample"
x:Class="ZeissCantinaMenuSample.ZeissCantinaMenuSamplePage">
<local:MenuItem x:Name="TestMenuItem" Text="Hallo" Image="AlertIcon.png" Clicked="TestMenuItem_Clicked" />
</ContentPage>
@robinmanuelthiel
robinmanuelthiel / EventHubService.cs
Created October 8, 2016 15:36
Connect to an Azure Event Hub manually
using DachauTemp.Windows.Models;
using Newtonsoft.Json;
using System;
using System.Globalization;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Windows.Security.Cryptography;
using Windows.Security.Cryptography.Core;