Skip to content

Instantly share code, notes, and snippets.

Avatar
🎹
Coding

Cezary Piątek cezarypiatek

🎹
Coding
View GitHub Profile
View CodeEditorUserControl.cs
//***************************************************************************
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// This code is licensed under the Visual Studio SDK license terms.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//***************************************************************************
View result.txt
SCENARIO: should activate regular license for vs2019
STEP 1: Register purchase for VS2019
STEP 2: Activate the license
STEP 3: Verify that license activated properly
View SigningAssembly.md
  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
View CodeCracker_disabled.editorconfig
# 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'
View .editorconfig
# 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
View indextemplate.json
{
"index_patterns": ["test_sample*web*"],
"settings": {
"number_of_shards": 1
},
"mappings": {
"doc": {
"_source": {
"enabled": true
},
View RaspeberrySpotify.txt
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 Sep 8, 2021
This snippet set severity level to error for different rules related to the reference nullability
View .editorconfig
[*.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.
View sample.cs
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApp9
{
public class Tenant
{
public string Key { get; set; }
View sample.cs
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);