Skip to content

Instantly share code, notes, and snippets.


Vasili Puchko zihotki

  • Infront ASA
  • Amsterdam, Netherlands
View GitHub Profile
zihotki / PerMinuteInExcessOf.cs
Created Aug 11, 2022 — forked from nblumhardt/PerMinuteInExcessOf.cs
Proof of concept rate limiting filter for Serilog
View PerMinuteInExcessOf.cs
using System;
using Serilog;
using Serilog.Configuration;
namespace ConsoleApplication8
static class Program
static void Main()
View gist:3881fe398f83dc2097c04f0233e56a9c
Install the Add the Microsoft.AspNet.HttpOverrides package
In your Configure() method add
app.UseOverrideHeaders(new OverrideHeaderMiddlewareOptions
ForwardedOptions = ForwardedHeaders.XForwardedFor |
zihotki / Lighter or Darker a Color.cs
Created Dec 17, 2017
.net C# make a color lighter or darker
View Lighter or Darker a Color.cs
/// <summary>
/// Creates color with corrected brightness.
/// </summary>
/// <param name="color">Color to correct.</param>
/// <param name="correctionFactor">The brightness correction factor. Must be between -1 and 1.
/// Negative values produce darker colors.</param>
/// <returns>
/// Corrected <see cref="Color"/> structure.
/// </returns>
public static Color ChangeColorBrightness(Color color, float correctionFactor)
zihotki /
Created Mar 15, 2017 — forked from btroncone/
A Comprehensive Introduction to @ngrx/store - Companion to Series

#Comprehensive Introduction to @ngrx/store By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

zihotki / .bash_profile
Created Jun 4, 2016
My personal settings for git
View .bash_profile
alias g=git
alias ls='/bin/ls -F --color=tty --show-control-chars'
alias ga='gitk --all&'
alias gs='git st'
zihotki / RecursiveStack.cs
Created May 31, 2016
Stack implementation using recursive links
View RecursiveStack.cs
using System;
public class Program
public static void Main()
var stack = new Stack();
zihotki / LogRequestModule.cs
Created Apr 6, 2016
Autofac module to write to debug output component resolve and activation messages
View LogRequestModule.cs
public class LogRequestModule : Module
public int depth = 0;
protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry,
IComponentRegistration registration)
registration.Preparing += RegistrationOnPreparing;
registration.Activating += RegistrationOnActivating;
//registration.Activated += RegistrationOnActivated;
zihotki / Export Table to Excel
Created Oct 10, 2013
Exporting html table to excel file
View Export Table to Excel
<script type="text/javascript">
function generate_excel(tableid) {
var table= document.getElementById(tableid);
var html = table.outerHTML;'data:application/;base64,' + base64_encode(html));
function base64_encode (data) {
// + original by: Tyler Akins (
View RenderPrintViewToString.cs
* Original Sample:
public class HomeController : Controller
public ActionResult Index()
string MyModelData = "";