Skip to content

Instantly share code, notes, and snippets.

View cezarypiatek's full-sized avatar
🎹
Coding

Cezary Piątek cezarypiatek

🎹
Coding
View GitHub Profile
@cezarypiatek
cezarypiatek / SigningAssembly.md
Last active January 28, 2024 16:37
Signing assembly
  1. Generate SNK file (you need to run console as admin)
& "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\sn.exe" -k ./MyKeys.snk
  1. Converting SNK file to base64 text file using PowerShell
# CC0095: Use string interpolation instead of arguments on Console.WriteLine
dotnet_diagnostic.CC0095.severity = none
# CC0118: Unnecessary '.ToString()' call in string concatenation.
dotnet_diagnostic.CC0118.severity = none
# CC0088: Consider use ""
dotnet_diagnostic.CC0088.severity = none
# CC0084: Consider use 'String.Empty'
@cezarypiatek
cezarypiatek / .editorconfig
Last active November 3, 2020 06:36
AsyncAnalyzers
# AsyncFixer01: Unnecessary async/await usage
dotnet_diagnostic.AsyncFixer01.severity = suggestion
# AsyncFixer02: Long-running or blocking operations inside an async method
dotnet_diagnostic.AsyncFixer02.severity = error
# VSTHRD103: Call async methods when in an async method
dotnet_diagnostic.VSTHRD103.severity = error
# AsyncFixer03: Fire & forget async void methods
{
"index_patterns": ["test_sample*web*"],
"settings": {
"number_of_shards": 1
},
"mappings": {
"doc": {
"_source": {
"enabled": true
},
if you are constantly switching between audio devices it would be best to symlink asoundrc to asound.conf
rm /etc/asound.conf
ln -s /home/pi/.asoundrc /etc/asound.conf
then restart raspotify everytime you change device
sudo service raspotify restart
-----
nano /etc/default/raspotify
https://pimylifeup.com/raspberry-pi-spotify/
@cezarypiatek
cezarypiatek / .editorconfig
Last active February 14, 2023 21:48
This snippet set severity level to error for different rules related to the reference nullability
[*.cs]
# CS8603: Possible null reference return.
dotnet_diagnostic.CS8603.severity = error
# CS8604: Possible null reference argument.
dotnet_diagnostic.CS8604.severity = error
# CS8606: Possible null reference assignment to iteration variable
dotnet_diagnostic.CS8606.severity = error
# CS8600: Converting null literal or possible null value to non-nullable type.
dotnet_diagnostic.CS8600.severity = error
# CS8602: Dereference of a possibly null reference.
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApp9
{
public class Tenant
{
public string Key { get; set; }
private static ITypeSymbol GetRangeVariableType(SemanticModel semanticModel, IRangeVariableSymbol symbol)
{
ITypeSymbol type = null;
if (!symbol.Locations.IsEmpty)
{
var location = symbol.Locations.First();
if (location.IsInSource && location.SourceTree == semanticModel.SyntaxTree)
{
var token = location.SourceTree.GetRoot().FindToken(symbol.Locations.First().SourceSpan.Start);
FROM mcr.microsoft.com/dotnet/core/sdk:3.1
RUN echo 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_10/ /' > /etc/apt/sources.list.d/network:messaging:zeromq:release-stable.list \
&& wget -nv https://download.opensuse.org/repositories/network:messaging:zeromq:release-stable/Debian_10/Release.key -O Release.key \
&& apt-key add - < Release.key \
RUN apt-get -y update \
&& apt-get -y install libzmq3-dev \
&& dpkg -L libzmq3-dev
<transformations>
<apps>
<app name="SampleApp1">
<templates>
<template name="appsettings.json" input="appsettings.json.template" />
<template output="nlog.config" input="nlog.config.template" />
</templates>
</app>
<app name="SampleApp2">
<templates>