Skip to content

Instantly share code, notes, and snippets.

@DBalashov
DBalashov / count-loc.ps1
Created March 20, 2024 15:04
Run in solution directory (example): powershell -F ..\count-loc.ps1
$extensions = @(".cs", ".vue", ".scss", ".ts")
$exclude = @("\bin\", "\obj\", "\node_modules\", "\.nuxt\", "\.output\")
$path = $args[0]
$files = Get-ChildItem -Recurse -Include ($extensions | % { '*' + $_ }) $path
$statLength = @{}
$statLOC = @{}
$totalLOC = 0;

Другие интересные штуки тут: https://t.me/notes_of_programmer

Таблицы, которым пора делать vacuum

select schemaname,
       relname,
       quote_ident(schemaname) || '.' || quote_ident(relname)   as full_table_name,
       n_live_tup,
       n_dead_tup,
using System.Data.Common;
using System.Text;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace PostgresExtensions;
/*
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
#pragma warning disable CS8618
var summary = BenchmarkRunner.Run<MainTest>();
@DBalashov
DBalashov / clickhouse_useful_queries.sql
Last active July 13, 2025 07:32
Clickhouse useful queries
-- Most heavy queries:
select type,
event_time,
initial_query_id,
query_id,
formatReadableSize(memory_usage) as memory,
used_functions,
used_aggregate_functions,
current_database,
result_rows,
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
#pragma warning disable CS8618
var summary = BenchmarkRunner.Run<MainTest>();
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
#pragma warning disable CS8618
var summary = BenchmarkRunner.Run<MainTest>();
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
#pragma warning disable CS8618
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
// | Method | Categories | N | Mean | Error | StdDev | Ratio |
// |----------------- |----------- |------- |--------------:|-------------:|-----------:|------:|
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
// | Method | Categories | N | Mean | Error | StdDev | Ratio |
// |------------------- |----------- |------- |--------------:|-----------:|-----------:|------:|