Skip to content

Instantly share code, notes, and snippets.

View Ams627's full-sized avatar

Adrian Sims Ams627

  • Barclays
  • Prague, Czech Republic
View GitHub Profile
@Ams627
Ams627 / clip.txt
Created October 3, 2025 10:12
Public gist from clipboard
SELECT
t.name AS TableName,
SUM(ps.row_count) AS [RowCount],
SUM(ps.used_page_count) * 8 AS [UsedSpaceKB],
SUM(ps.reserved_page_count) * 8 AS [ReservedSpaceKB]
FROM sys.dm_db_partition_stats AS ps
JOIN sys.tables AS t ON ps.object_id = t.object_id
GROUP BY t.name
ORDER BY [UsedSpaceKB] DESC;
@Ams627
Ams627 / clip.txt
Created October 3, 2025 10:12
Public gist from clipboard
SELECT
t.name AS TableName,
SUM(ps.row_count) AS [RowCount],
SUM(ps.used_page_count) * 8 AS [UsedSpaceKB],
SUM(ps.reserved_page_count) * 8 AS [ReservedSpaceKB]
FROM sys.dm_db_partition_stats AS ps
JOIN sys.tables AS t ON ps.object_id = t.object_id
WHERE t.name = N'MyTable'
GROUP BY t.name;
@Ams627
Ams627 / clip.txt
Created October 3, 2025 10:12
Public gist from clipboard
DBCC UPDATEUSAGE (0) WITH COUNT_ROWS;
EXEC sp_spaceused N'dbo.MyTable';
@Ams627
Ams627 / clip.txt
Created October 3, 2025 10:12
Public gist from clipboard
EXEC sp_spaceused N'dbo.MyTable';
@Ams627
Ams627 / clip.txt
Created October 2, 2025 09:28
Public gist from clipboard
<Project>
<PropertyGroup>
<Dog>$(Configuration)</Dog>
</PropertyGroup>
</Project>
@Ams627
Ams627 / clip.txt
Created October 2, 2025 07:32
Public gist from clipboard
<Project>
<Target Name="ShowTfmForRestore" BeforeTargets="Restore">
<Message Importance="High" Text="TFM: $(TargetFramework)" />
<Message Importance="High" Text="TFMs: $(TargetFrameworks)" />
<Message Importance="High" Text="ImportDirectoryBuildProps=$(ImportDirectoryBuildProps)" />
<Message Importance="High" Text="Project: $(MSBuildProjectFullPath)" />
</Target>
</Project>
@Ams627
Ams627 / clip.txt
Created October 2, 2025 06:40
Public gist from clipboard
<Message
Text="Metadata list: @(AssemblyMetadata->'%(Identity)=%(Value)', ', ')" />
@Ams627
Ams627 / clip.txt
Created October 2, 2025 06:40
Public gist from clipboard
<Message Text="Metadata list for %(AssemblyMetadata.Identity): Value=%(AssemblyMetadata.Value) OtherMeta=%(AssemblyMetadata.OtherMeta)" />
@Ams627
Ams627 / clip.txt
Created October 1, 2025 14:17
Public gist from clipboard
<Project>
<PropertyGroup>
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>true</AppendRuntimeIdentifierToOutputPath>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0-windows</TargetFrameworks>
<PlatformTarget>x64</PlatformTarget>
<DebugType>Embedded</DebugType>
<LangVersion>Latest</LangVersion>
<UseArtifactsOutput>true</UseArtifactsOutput>
@Ams627
Ams627 / clip.txt
Created October 1, 2025 06:20
Public gist from clipboard
auto a = authors, e = expected;
std::sort(a.begin(), a.end(), /* comparator */);
std::sort(e.begin(), e.end(), /* comparator */);
EXPECT_EQ(a, e);