Skip to content

Instantly share code, notes, and snippets.

View oledid's full-sized avatar
😃
On duty

Ole Morten Didriksen Graskopf oledid

😃
On duty
View GitHub Profile
@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 / 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 / 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 / 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
{
<!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 / CommonEntityBaseExtensions.cs
Last active March 15, 2019 13:07
Serialize LLBLGEN Entity to json without LLBLGEN-specific fields
using System.Collections.Generic;
using System.Dynamic;
using Newtonsoft.Json;
using Your.ORM.EntityClasses; // <- replace
namespace Your.Namespace // <-
{
public static class CommonEntityBaseExtensions
{
/// <summary>
@oledid
oledid / How to measure disk-performance in Windows.md
Created September 5, 2017 10:15
How to measure disk-performance in Windows
@oledid
oledid / register a myget feed.markdown
Created August 17, 2017 13:02 — forked from xavierdecoster/register a myget feed.markdown
Store MyGet credentials in your roaming user profile NuGet.config

Execute the following script using your MyGet [feedUrl] and MyGet [username] , [password] and [apikey]. Run this from a commandline where you have access to nuget.exe (or set the path to your nuget.exe in a system environment variable).

Store credentials in machine-level nuget.config (non-transferable)

nuget setapikey [apikey] -source [feedUrl]
nuget sources add|update -Name [name] -source [feedUrl] -User [username] -pass [password]
@oledid
oledid / km-0414.md
Last active April 24, 2021 16:48
Norwegian keyboard mapping for XRDP
@oledid
oledid / rdp_audio_settings.md
Last active July 19, 2017 15:08
Remote Desktop audio settings