Skip to content

Instantly share code, notes, and snippets.

@PadreSVK
PadreSVK / original.csproj
Last active June 20, 2019 14:59
Remove dot... items from None group
<ItemGroup>
<None Remove="Views\CRUD\Create.dothtml" />
<None Remove="Views\CRUD\Detail.dothtml" />
<None Remove="Views\CRUD\Edit.dothtml" />
<None Remove="Views\MasterPage.dotmaster" />
</ItemGroup>
@PadreSVK
PadreSVK / updated.csproj
Last active July 1, 2019 07:22
Csproj after clean up and simplifying
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Content Include="**/*.dothtml;**/*.dotmaster;**/*.dotcontrol" Exclude="obj/**/*.*;bin/**/*.*" CopyToPublishDirectory="Always" />
</ItemGroup>
<ItemGroup>
<None Remove="dotvvm_serialized_config.json.tmp" />
<None Remove="**/*.dothtml;**/*.dotmaster;**/*.dotcontrol" />
To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions, Action`1 configureOptions)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, KestrelServerOptions serverOptions, ILogger logger, Func`2 createBinding)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
@PadreSVK
PadreSVK / renew-certificate.ps1
Created July 15, 2019 07:20
snippet for renew certificate for kestrel
dotnet dev-certs https --clean
dotnet dev-certs https --trust
@PadreSVK
PadreSVK / GetGitWork.ps1
Created July 24, 2019 12:15
Script for merge commit messages and copy to clipboard
<#
.SYNOPSIS
Since is in format "2013-01-30" or "6AM"
#>
function GetGitWork([string]$since,[string] $pathToProject, [string]$authorName){
if([string]::IsNullOrEmpty($since)){
$since = "6am";
}
#if is $pathToProjectEmpty search current directory
@PadreSVK
PadreSVK / cleanup-bin-obj-.vs-force.ps1
Created August 9, 2019 12:30
Script for force delete files in bin, obj and .vs (Visual Studio cache) folder.
# script in sudo will be evaluated with admin permission. Lockhunter unlock and delete files
# PREREQUISITES:
# sudo / http://blog.lukesampson.com/sudo-for-windows
# lockhunter / https://lockhunter.com/download.htm
#check dependencies
@("sudo", "lockhunter.exe") | where { -Not (Get-Command $_ -errorAction SilentlyContinue)} | %{ Write-Warning "missing $_ command"; return $_} | Write-Error "Install missing dependencies!" -ErrorAction Stop
Write-Host "start cleaning"
sudo {
Get-ChildItem .\ -include bin,obj -Recurse | %{ lockhunter.exe -d $_.fullname }
@PadreSVK
PadreSVK / Using-Object.ps1
Created August 14, 2019 17:35
Snippet for c# style using statement in PS
function Using-Object
{
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[AllowEmptyString()]
[AllowEmptyCollection()]
[AllowNull()]
[Object]
@PadreSVK
PadreSVK / mqrabbitconsumer.ps1
Created August 14, 2019 17:38
Script for rabbitmq "consumer" in powershell. It use .NET RabbitMQ client - https://github.com/rabbitmq/rabbitmq-dotnet-client
$assemblyPath = "TODO PATH"; # path to RabbitMQ.Client.dll - https://github.com/rabbitmq/rabbitmq-dotnet-client
$queueName = "testqueue"
$hostName = "localhost"
$bytes = [System.IO.File]::ReadAllBytes($assemblyPath);
[System.Reflection.Assembly]::Load($bytes);
$factory = New-Object RabbitMQ.Client.ConnectionFactory;
$factory.HostName = $hostName;
@PadreSVK
PadreSVK / mqrabbitproducer.ps1
Created August 14, 2019 17:45
Script for rabbitmq "producer" in powershell. It use .NET RabbitMQ client - https://github.com/rabbitmq/rabbitmq-dotnet-client
$AssemblyPath = "TODO PATH"; # path to RabbitMQ.Client.dll - https://github.com/rabbitmq/rabbitmq-dotnet-client
$queueName = "testqueue"
$hostName = "localhost"
$bytes = [System.IO.File]::ReadAllBytes($AssemblyPath);
[System.Reflection.Assembly]::Load($bytes);
$factory = New-Object RabbitMQ.Client.ConnectionFactory;
@PadreSVK
PadreSVK / install.ps1
Last active September 18, 2019 13:29
Choco install script
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
refreshenv
$PROFILE
choco install toggl -y
choco install microsoft-teams -y
choco install git -y