Skip to content

Instantly share code, notes, and snippets.

View rasmuseeg's full-sized avatar
💭
Coding ofc.

Rasmus Eeg Møller rasmuseeg

💭
Coding ofc.
View GitHub Profile
@rasmuseeg
rasmuseeg / versioning.yml
Created February 10, 2022 20:03
Azure variable template for verisoning
variables:
version.counter: $[counter(format('{0}_{1}', variables['Build.DefinitionName'], variables['Build.SourceBranchName']), 1)]
version.suffix: $[format('alpha-{0}{1}', variables['Build.SourceBranchName'], variables['version.counter'])] # Unknown branches are WIP
${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/release/') }}:
version.suffix: $[format('rc-{0}{1}', variables['Build.SourceBranchName'], variables['version.counter'])] # Ready for release
${{ if eq(variables['Build.SourceBranchName'], 'main') }}:
version.suffix: '' # No suffix for releases
using System;
using System.Linq;
using System.Web;
using System.Web.Mvc;
public static class UrlHelperExtensions
{
/// <summary>
/// Modified QueryString with key to value
/// </summary>
@rasmuseeg
rasmuseeg / ConvertFrom-UnixTime
Created October 8, 2021 13:12
Converts unix or epoch times to DateTime object.
function ConvertFrom-UnixTime {
[CmdletBinding(DefaultParameterSetName = "Seconds")]
param (
[Parameter(Position = 0,
ValueFromPipeline = $true,
Mandatory = $true,
ParameterSetName = "Seconds")]
[int]
$Seconds,
@rasmuseeg
rasmuseeg / VBScript class for json encode decode
Last active September 28, 2021 12:08 — forked from douglascrp/VBScript class for json encode decode
JSON encode decode with VBScript
Reference: http://demon.tw/my-work/vbs-json.html
VbsJson class for parsing JSON format data with VBS
Tags: JavaScript , JSON , VB , VBS , VBScript
Title: The VBS resolve VbsJson class of JSON data format of: Demon
Link: http://demon.tw/my-work/vbs-json.html
Copyright: All articles in this blog are subject to the terms of " Signature - Non-Commercial Use - Share 2.5 China in the Same Way ".
@rasmuseeg
rasmuseeg / Dockerfile
Last active August 19, 2021 07:20
The following example allows .NET 4.7.2 console applications to listen for SIGINT, SIGTERM inside windows containers.
# This causes Windows to wait the specified number of seconds before sending CTRL_SHUTDOWN_EVENT to the process.
# #RUN reg add hklm\system\currentcontrolset\services\cexecsvc /v ProcessShutdownTimeoutSeconds /t REG_DWORD /d 7200
# This causes Windows to wait the specified number of milliseconds before killing a process after issuing a CTRL_SHUTDOWN_EVENT - essentially the rough equivalent of docker stop -t.
RUN reg add hklm\system\currentcontrolset\control /v WaitToKillServiceTimeout /t REG_SZ /d 7200000 /f
@rasmuseeg
rasmuseeg / ConvertFrom-Ini.ps1
Last active August 9, 2021 12:46
Read ini file contents using powershell
function ConvertFrom-Ini ($filePath)
{
$ini = @{}
$section = $ini
switch -regex -file $FilePath
{
“^\[(.+)\]” # Section
{
$section = $matches[1]
$ini.Add($section,@{})
@rasmuseeg
rasmuseeg / docker-compose.yml
Created April 15, 2020 08:05
Minecraft Bedrock Server with Docker
version: "3.7"
services:
mcbedrock:
stdin_open: true
tty: true
image: itzg/minecraft-bedrock-server
restart: always
ports:
- "19132:19132/udp"
@rasmuseeg
rasmuseeg / Increment-ClientDependencyVersion.ps1
Created April 17, 2019 07:04
Increment clientdependency.config version during continues deployment
param(
[Parameter(Position=0,
HelpMessage="Path to your project.")]
[ValidateNotNullOrEmpty()]
[string]
$ProjectPath = "..\DanskBilglas.UmbracoCMS\Config\",
[Parameter(Position=1,
HelpMessage="Name of your client dependency config (default: ClientDependency.config)")]
[string]
@rasmuseeg
rasmuseeg / Custom.config
Last active March 27, 2019 13:54
uCommerce Umbraco 7 UI.xml transform and file copy post install
<!--
Custom configuration for uCommerce components.
Find the ID of component you want to override
and use the same ID here. Your component will
override the default.
You can configure new components here as well
and have them injected into existing ones.
-->
@rasmuseeg
rasmuseeg / web.config
Last active January 12, 2018 11:50
MSSQL Local DB Connection String
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\MyDatabase.mdf;Initial Catalog=MyDatabase;Integrated Security=True" providerName="System.Data.SqlClient" />