Skip to content

Instantly share code, notes, and snippets.

View dariusz-wozniak's full-sized avatar
🏀

Dariusz Woźniak dariusz-wozniak

🏀
View GitHub Profile
@dariusz-wozniak
dariusz-wozniak / search_all.sql
Created July 14, 2022 14:43
SQL: Search all tables and all columns for a specific value
DECLARE @SearchStr nvarchar(100)
SET @SearchStr = '## YOUR STRING HERE ##'
-- Copyright © 2002 Narayana Vyas Kondreddi. All rights reserved.
-- Purpose: To search all columns of all tables for a given search string
-- Written by: Narayana Vyas Kondreddi
-- Site: http://vyaskn.tripod.com
-- Updated and tested by Tim Gaunt
-- http://www.thesitedoctor.co.uk
@EgorBo
EgorBo / Dynamic PGO in .NET 6.0.md
Last active January 25, 2024 15:15
Dynamic PGO in .NET 6.0.md

Dynamic PGO in .NET 6.0

Dynamic PGO (Profile-guided optimization) is a JIT-compiler optimization technique that allows JIT to collect additional information about surroundings (aka profile) in tier0 codegen in order to rely on it later during promotion from tier0 to tier1 for hot methods to make them even more efficient.

What exactly PGO can optimize for us?

  1. Profile-driving inlining - inliner relies on PGO data and can be very aggressive for hot paths and care less about cold ones, see dotnet/runtime#52708 and dotnet/runtime#55478. A good example where it has visible effects is this StringBuilder benchmark:

  2. Guarded devirtualization - most monomorphic virtual/interface calls can be devirtualized using PGO data, e.g.:

void DisposeMe(IDisposable d)
@davidfowl
davidfowl / .NET6Migration.md
Last active April 11, 2024 02:02
.NET 6 ASP.NET Core Migration
@dariusz-wozniak
dariusz-wozniak / ShouldAsync.cs
Last active April 5, 2022 10:33
FluentAssertions - Should async
Func<Task> act = async () => await sut.DoSth(null!);
await act.Should().ThrowExactlyAsync<ArgumentNullException>();
@jacobjones
jacobjones / MissingProperties.aspx
Last active December 5, 2022 15:01
Missing Properties Plugin for Episerver
<%@ Page Language="c#" EnableViewState="true" CodeBehind="MissingProperties.aspx.cs" AutoEventWireup="False" Inherits="EPiServer.Reference.Commerce.Site.Plugins.MissingProperties" Title="Missing Properties" %>
<%@ Register TagPrefix="EPiServerUI" Namespace="EPiServer.UI.WebControls" Assembly="EPiServer.UI, Version=11.21.4.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7" %>
<asp:content contentplaceholderid="MainRegion" runat="server">
<div class="epi-formArea" ID="Pagetypes" runat="server">
<div class="epi-size25">
<div>
<asp:GridView ItemType="EPiServer.Reference.Commerce.Site.Plugins.MissingProperties.Result" ID="PropertiesViewControl" runat="server" AutoGenerateColumns="false" >
<Columns>
<asp:TemplateField HeaderText="Type" ItemStyle-Wrap="false">
@dariusz-wozniak
dariusz-wozniak / new-guid.ps1
Last active January 30, 2020 12:32
Create a new GUID and copy to clipboard with no newlines
[guid]::newguid().ToString() | scb
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@samoshkin
samoshkin / postman_vs_insomnia_comparison.md
Created November 6, 2018 17:42
Comparison of API development environments: Postman vs Insomnia

Postman vs Insomnia comparison

Postman | API Development Environment https://www.getpostman.com
Insomnia REST Client - https://insomnia.rest/

Features                                        Insomnia Postman Notes
Create and send HTTP requests x x
Authorization header helpers x x Can create "Authorization" header for you for different authentication schemes: Basic, Digest, OAuth, Bearer Token, HAWK, AWS
@marbel82
marbel82 / EnumGetValuesCastBenchmark.md
Last active August 18, 2022 13:18
When we iterate on the Enum values, why it is faster when we explicitly cast type?

This post refers to:

  • [Simple test of Enum.GetValues() with casting type and without][my_prev_enum_simple]
  • stackoverflow.com: [How do I iterate over an enum?][stack_comm_enum_bdn]
  • [bartoszkp/EnumGetValuesTest.cs][bartoszkp_enum]

When we iterate on the Enum values, why it is faster when we explicitly cast type?