Skip to content

Instantly share code, notes, and snippets.

View dariusz-wozniak's full-sized avatar
🏀

Dariusz Woźniak dariusz-wozniak

🏀
View GitHub Profile
@sanjacob
sanjacob / download.py
Created March 11, 2024 22:03
Download all the animated emojis from Google Noto Emoji
# Copyright (C) 2024 by sanjacob
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
# DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
# OR PERFORMANCE OF THIS SOFTWARE.
@KaanGaming
KaanGaming / ilopcodes.md
Last active November 30, 2024 12:50
Useful IL opcodes

Useful IL Opcodes

IL opcodes documentation designed with dynamically building assemblies in C# in mind. This documentation implies you know the basics of C# and programming fundamentals, but not how a computer operates at the deep level of understanding (e.g. stacks, heap, instructions, opcodes, etc.)

What's IL?

If you don't know what IL is, it stands for Intermediate Language, also referred to as Common Intermediate Language (CIL). CIL is the one that's used in generating IL code for dynamic assemblies in C#.

@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 13, 2025 11:13
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, 2025 11:12
.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 8, 2025 14:18
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;
}