Skip to content

Instantly share code, notes, and snippets.

@vchirikov
vchirikov / loc_cmd
Last active August 25, 2018 23:41
Line of code, git windows / linux / macos
// https://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
git diff --shortstat 4b825dc642cb6eb9a060e54bf8d69288fbee4904
@vchirikov
vchirikov / roslynator_for_vscode.ps1
Created August 30, 2018 12:22
Download, unzip and enable Roslynator for Visual Studio Code
# https://github.com/JosefPihrt/Roslynator/issues/38
# by @VahidN
Write-Host "Download, unzip and enable Roslynator for Visual Studio Code"
$name = "josefpihrt.Roslynator2017"
$url = "https://marketplace.visualstudio.com/items?itemName=$name"
$currentDir = $PSScriptRoot
$file = "$currentDir\Roslynator.zip"
$pattern = "<script class=`"vss-extension`" defer=`"defer`" type=`"application\/json`">(.*?)<\/script>"
@vchirikov
vchirikov / package-manager console command.txt
Created September 7, 2018 17:39
Add autogenerated binding redirects
Add-BindingRedirect *
@vchirikov
vchirikov / dotnetlayout.md
Created October 7, 2018 17:05 — forked from davidfowl/dotnetlayout.md
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@vchirikov
vchirikov / concfg_preset_qcmd.json
Created October 14, 2018 22:21
My concfg color scheme
{
"black": "#272C33",
"dark_blue": "#4FB4D8",
"dark_green": "#78BD65",
"dark_cyan": "#00DCDC",
"dark_red": "#EB3D54",
"dark_magenta": "#9b37e2",
"dark_yellow": "#cd9731",
"gray": "#CBCDD2",
"dark_gray": "#CBCDD2",
@vchirikov
vchirikov / .gitconfig
Last active August 17, 2020 07:37
Git config
[user]
name = vchirikov
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[core]
@vchirikov
vchirikov / perfview_gc.cmd
Created October 30, 2018 14:13
Perfview command that can help found problems with GC
# https://blogs.msdn.microsoft.com/maoni/2018/10/09/you-should-never-see-this-callstack-in-production/
PerfView64.exe /nogui /accepteula /BufferSizeMB:4096 /CircularMB:2000 /CollectMultiple:3 /StopOnGcOverMsec:3000 /DelayAfterTriggerSec:0 /KernelEvents:Memory,VirtualAlloc,Default /Process:"w3wp" /OnlyProviders:"ClrPrivate:1:5,Clr:0x40000001:5" /NoRundown /NoNGenRundown /NoClrRundown /Merge:true /Zip:true collect
@vchirikov
vchirikov / fusion.bat
Last active August 23, 2019 10:01
CLR Fusion log collection
@echo off
SET PERFVIEW=C:\tools\PerfView64.exe
SET FUSLOGPATH=%~dp0
echo Press enter when ready to start collection...
pause
reg add HKLM\Software\Microsoft\Fusion /reg:64 /f /v EnableLog /t REG_DWORD /d 1
reg add HKLM\Software\Microsoft\Fusion /reg:64 /f /v LogFailures /t REG_DWORD /d 1
reg add HKLM\Software\Microsoft\Fusion /reg:64 /f /v LogResourceBinds /t REG_DWORD /d 0
reg add HKLM\Software\Microsoft\Fusion /reg:64 /f /v LogPath /t REG_SZ /d %FUSLOGPATH%
@vchirikov
vchirikov / ObjectPropertiesReadersFactory.cs
Created May 21, 2019 11:55
Factory for creating readers of the properties of the anonymous (and not only) types
void Main()
{
var generator = new ObjectPropertiesReadersFactory();
var obj = new { @class = "css-class", @value = 2, items = new[] {1,2,3} };
// var obj = new TestClass{ items = "123" };
var reader = generator.GetReader(obj.GetType());
var result = new Dictionary<string, object>();
reader(result, obj);
result.Dump();
@vchirikov
vchirikov / _NT_SYMBOL_PATH
Created July 23, 2019 08:24
_NT_SYMBOL_PATH
SRV*C:\dbg_symbol_cache*http://referencesource.microsoft.com/symbols;SRV*C:\dbg_symbol_cache*https://nuget.smbsrc.net;SRV*C:\dbg_symbol_cache*http://msdl.microsoft.com/download/symbols