Skip to content

Instantly share code, notes, and snippets.

View TheDayIsMyEnemy's full-sized avatar
:octocat:
Focusing

TheDayIsMyEnemy

:octocat:
Focusing
  • Sofia, Bulgaria
  • 21:16 (UTC +03:00)
View GitHub Profile
@jcubic
jcubic / cdn.md
Last active April 21, 2024 14:43
How to setup a literally free CDN
@ZacharyPatten
ZacharyPatten / Accessing C#|VB|F# XML Code Documentation via Reflection.md
Last active October 19, 2023 18:22
[April 24, 2019] A blog post about accessing XML documentation via reflection in dotnet code

Accessing C#|VB|F# XML Code Documentation via Reflection

Date: April 24, 2019

In this post I will demonstrate how you can easily load C#|VB|F# XML code documentation and access it via reflection (using extension methods).

Note: The method described in this post only works if you are able to get the “.xml” file generated by Visual Studio when the code is built.

Author Edit (2020.7.27): The latest source code for this topics is included in the https://github.com/ZacharyPatten/Towel repository.

Why would you want to do this?

@johnfedoruk
johnfedoruk / clamd-setup.md
Last active April 29, 2024 11:43
Setting up ClamAV

ClamAV Setup Notes

Context

ClamAV can be used in a few different ways. Most importantly, it provides the ability to scan files in realtime (on-access) or to scan the file system periodically.

I tried configuring ClamAV to both perform on-access virus scanning and to perform nightly full filesystem scanning. Using the on-access option did not prove to be very useful, however a scheduled full system scan seems to be of value.

Here is my story.

using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
namespace TestConsole
{
// From https://stackoverflow.com/a/41392145/4213397
@StevenACoffman
StevenACoffman / Homoglyphs.md
Last active April 27, 2024 22:45
Unicode Look-alikes

Unicode Character Look-Alikes

Original Letter Look-Alike(s)
a а ạ ą ä à á ą
c с ƈ ċ
d ԁ ɗ
e е ẹ ė é è
g ġ
h һ
@MichaelSimons
MichaelSimons / RetrievingDockerImageSizes.md
Last active March 25, 2024 11:14
Retrieving Docker Image Sizes

Retrieving Docker Image Sizes

There are two metrics that are important to consider when discussing the size of Docker images.

  1. Compressed size - This is often referred to as the wire size. This affects how fast/slow images can be pulled from a registry. This impacts the first run experience on machines where images are not cached.
  2. Uncompressed size - This is often referred to as the size on disk. This affects how much local storage is required to support your Docker workloads.

The example commands shown below will work on Windows, MacOS, and Linux.

How to Measure the Compressed Size

@GetoXs
GetoXs / ServiceCollectionExtentions.cs
Last active March 2, 2024 06:06
Register All Types (with Generic) in .NET Core DependencyInjection
using System;
using System.Linq;
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
public static class ServiceCollectionExtentions
{
public static void AddAllTypes<T>(this IServiceCollection services
, Assembly[] assemblies
, bool additionalRegisterTypesByThemself = false
@SteveSandersonMS
SteveSandersonMS / blazor-error-handling.md
Last active April 10, 2024 13:26
Error handling in Server-Side Blazor

Error handling in Server-Side Blazor

Developers building Blazor applications should be aware of how the framework deals with exceptions, and what steps to take in order to maximize reliability and to detect and diagnose errors.

To recap, server-side Blazor is a stateful framework. For as long as users are interacting with your application, they maintain a connection to the server known as a circuit. The circuit holds all the active component instances, plus many other aspects of state such as the components' most recent render output and the current set of event-handling delegates that could be triggered by client-side events. If a user opens your application in multiple browser tabs, then they have multiple independent circuits.

As a high-level principle, Blazor treats most unhandled exceptions as fatal to that circuit. If a circuit is terminated due to an unhandled exception, the user can only continue by reloading the page to create a new circuit and starting again, although other circuits (e.g., th

@bmaupin
bmaupin / free-database-hosting.md
Last active May 2, 2024 05:29
Free database hosting
https://accounts.google.com/signin/v2/sl/pwd?
service=mail
&hl=en
&uilel=1
&continue=https://www.gmail.com