Skip to content

Instantly share code, notes, and snippets.

View DimaSavostianov's full-sized avatar

DimaSavostianov

  • Moscow, Russian Federation
View GitHub Profile
@DimaSavostianov
DimaSavostianov / string_agg.sql
Created July 1, 2020 17:01
string_agg() analogue for SQL Server 2016
DECLARE @tbl TABLE (
[name] NVARCHAR(100)
,depart NVARCHAR(100)
,email NVARCHAR(100));
INSERT INTO @tbl
([name], depart, email) VALUES
('John', 'Depart1', 'john@mail.ru')
, ('Ann', 'Depart1', 'ann@mail.ru')
, ('Mike', 'Depart2', 'mike@mail.ru')
@DimaSavostianov
DimaSavostianov / gist:dd92a3eb7bf7b499ddd60b246532fcf4
Created March 14, 2017 19:31
c# webbrowser memory leak SOLUTION
public partial class Form1 : Form
{
[DllImport("KERNEL32.DLL", EntryPoint = "SetProcessWorkingSetSize", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
internal static extern bool SetProcessWorkingSetSize(IntPtr pProcess, int dwMinimumWorkingSetSize, int dwMaximumWorkingSetSize);
[DllImport("KERNEL32.DLL", EntryPoint = "GetCurrentProcess", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
internal static extern IntPtr GetCurrentProcess();
private void ReNewBrowser()
{