Skip to content

Instantly share code, notes, and snippets.

View oledid's full-sized avatar
😃
On duty

Ole Morten Didriksen oledid

😃
On duty
View GitHub Profile
@oledid
oledid / index.html
Created October 16, 2019 14:15 — forked from DavidWells/index.html
Webpack DLL setup for projects. How it works: https://github.com/MoOx/phenomic/issues/532#issuecomment-233830928
<!doctype html public>
<meta charset="utf-8"/>
<title>HTML with venderPackages.dll.js</title>
<body>
<div id="root"></div>
<!-- node_modules/PROJECT-NAME-TEMP-FOLDERNAME-dll/vendorPackages.dll.js generated by postinstall.js running webpack with webpack.dll.config.js -->
<script src="/vendorPackages.dll.js"></script>
<script src="/__build__/bundle.js"></script>
</body>
</html>
@oledid
oledid / Core_BuildDateAttribute.cs
Last active November 1, 2019 09:52
BuildDateAttribute - get build-date in build for cache-busting
// https://www.meziantou.net/getting-the-date-of-build-of-a-dotnet-assembly-at-runtime.htm
using System;
using System.Globalization;
namespace Core
{
[AttributeUsage(AttributeTargets.Assembly)]
public class BuildDateAttribute : Attribute
{
@oledid
oledid / Startup.cs
Last active April 3, 2020 08:47
OpenIdConnect against ID-porten, an example for ASP .NET Core 3.1
using System;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
@oledid
oledid / ogg2mp3.ps1
Created May 20, 2020 07:15
Convert files in folder from ogg to mp3, if they are not already converted
# using powershell core and ffmpeg
ls *.ogg | where { -Not (Test-Path $_.FullName.Replace(".ogg", ".mp3")) } | foreach {
$fullName = $_.FullName;
$output = $_.FullName.Replace('.ogg', '.mp3');
ffmpeg -i "$fullName" "$output"
}
@oledid
oledid / run-jetbrains-inspectcode.ps1
Last active March 19, 2021 18:48
Visual Studio Code-task and problem matcher for JetBrains InspectCode
dotnet tool install -g JetBrains.ReSharper.GlobalTools
jb inspectcode (Get-Item *.sln).FullName -o="jetbrains-inspectcode-results.xml" --absolute-paths --DotNetCore="C:\Program Files\dotnet\dotnet.exe"
Get-Content jetbrains-inspectcode-results.xml
@oledid
oledid / Manage-App-Service-Plan.md
Created April 23, 2021 18:15 — forked from mmckechney/Manage-App-Service-Plan.md
PowerShell and CLI to manage App Service Plan sizing

Manage App Service Plan count and SKU

Get the number of worker nodes serving the app service plan

(Get-AzAppServicePlan -ResourceGroupName "<resource group name>" -Name "<app service plan name>").Sku.Capacity
@oledid
oledid / km-0414.md
Last active April 24, 2021 16:48
Norwegian keyboard mapping for XRDP
@oledid
oledid / make-vc-keys.ps1
Created June 14, 2021 11:15 — forked from srvrguy/make-vc-keys.ps1
A PowerShell script to make a 2048-bit RSA keypair. Saves the files in XML format in the user's document directory.
# Create a 2048-bit RSA Keypair in XML format
#
# @author Michael Johnson <michael.johnson@snap.md>
# @copyright 2016 SnapMD, Inc.
# @license https://opensource.org/licenses/BSD-2-Clause Simplified BSD License
<#
Copyright (c) 2016, SnapMD, Inc.
All rights reserved.
@oledid
oledid / resubmit-failed-logic-app-runs.ps1
Last active October 25, 2022 18:37
Resubmit failed logic app runs
############################################################
# Resubmit failed logic app runs
############################################################
# Sources:
# https://github.com/Azure/logicapps/tree/master/scripts/resubmit-all-failed-runs
# https://github.com/Azure/azure-powershell/issues/7752
import-module Az