Skip to content

Instantly share code, notes, and snippets.

View FrankDeGroot's full-sized avatar

Frank de Groot - Schouten FrankDeGroot

View GitHub Profile
param location string
param webAppName string
param keyVaultName string
param applicationInsightsConnectionString string
var appServicePlanName = 'sitePlan-${webAppName}'
resource appServicePlan 'Microsoft.Web/serverfarms@2024-04-01' = {
name: appServicePlanName
param location string = resourceGroup().location
param webAppName string
param keyVaultName string
param dateTime string = utcNow()
module appInsights '../applicationInsights.bicep' = {
name: 'appInsights-${dateTime}'
params: {
location: location
pool: default
trigger:
paths:
include:
- .azuredevops/release.yml
- Deployment
- testArtifacts
resources:
pool: default
trigger:
paths:
exclude:
- .azuredevops/release.yml
- Deployment/*
- testArtifacts/*
jobs:
jobs:
- job: Build
variables:
# Make it easier to cache packages (see labs)
# https://learn.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages/
steps:
- task: DotNetCoreCLI@2
steps:
- task: AzureCLI@2
name: getSpnDetails
inputs:
azureSubscription: ${{parameters.AzureDevOpsServiceConnection}}
scriptType: pscore
scriptLocation: inlineScript
addSpnToEnvironment: true
inlineScript: |
Write-Host "##vso[task.setvariable variable=serviceConnectionClientId;secret]$($env:servicePrincipalId)"
for (const template of document.getElementsByTagName("template")) {
customElements.define(
template.id,
class extends HTMLElement {
constructor() {
super();
this.attachShadow({
mode: "open"
}).appendChild(template.content.cloneNode(true));
}
FN+R = Break
FN+S = Sys Rq
FN+C = Scroll Lock
FN+E = Insert
FN+W = Pause
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
@FrankDeGroot
FrankDeGroot / Pem2Jws.java
Created February 1, 2022 11:28
Create JWS from PEM
private String readPublicKey() throws Exception {
val key = new String(this.getClass().getResourceAsStream("/publicKey.pem").readAllBytes())
.replace("-----BEGIN PUBLIC KEY-----", "")
.replaceAll(System.lineSeparator(), "")
.replace("-----END PUBLIC KEY-----", "");
val encoded = Base64.getDecoder().decode(key);
val keySpec = new X509EncodedKeySpec(encoded);
val keyFactory = KeyFactory.getInstance("RSA");
val jsonWebKey = PublicJsonWebKey.Factory.newPublicJwk(keyFactory.generatePublic(keySpec));
val jsonWebKeySet = new JsonWebKeySet(jsonWebKey);