Skip to content

Instantly share code, notes, and snippets.

View zihotki's full-sized avatar

Vasili Puchko zihotki

  • Infront ASA
  • Amsterdam, Netherlands
View GitHub Profile
@zihotki
zihotki / TFSBuildVarsDebug.ps1
Created October 9, 2023 00:09 — forked from heiswayi/TFSBuildVarsDebug.ps1
List all TFS built-in variables for Team Foundation Build (vNext) using PowerShell script
Write-Host "SYSTEM_TEAMPROJECT: $ENV:SYSTEM_TEAMPROJECT"
Write-Host "SYSTEM_TEAMFOUNDATIONSERVERURI: $ENV:SYSTEM_TEAMFOUNDATIONSERVERURI"
Write-Host "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI: $ENV:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"
Write-Host "SYSTEM_COLLECTIONID: $ENV:SYSTEM_COLLECTIONID"
Write-Host "SYSTEM_DEFAULTWORKINGDIRECTORY: $ENV:SYSTEM_DEFAULTWORKINGDIRECTORY"
Write-Host "BUILD_DEFINITIONNAME: $ENV:BUILD_DEFINITIONNAME"
Write-Host "BUILD_DEFINITIONVERSION: $ENV:BUILD_DEFINITIONVERSION"
Write-Host "BUILD_BUILDNUMBER: $ENV:BUILD_BUILDNUMBER"
Write-Host "BUILD_BUILDURI: $ENV:BUILD_BUILDURI"
Write-Host "BUILD_BUILDID: $ENV:BUILD_BUILDID"
@zihotki
zihotki / export-multiple-parts.py
Created September 12, 2023 10:54
freecad export multiple parts
from PySide import QtGui
folder = str(QtGui.QFileDialog.getExistingDirectory(None, "Select Directory"))
a = Gui.Selection.getSelection()
count = 0
import ImportGui
options = None
if hasattr(ImportGui, "exportOptions"):
options = ImportGui.exportOptions(".step")
for b in a:
objs = []
@zihotki
zihotki / Angular 14+ async validator with de-bounce.ts
Created August 21, 2023 11:39
Angular 14+ async validator with de-bounce
employerCodeExists(): AsyncValidatorFn {
return (control: AbstractControl): Observable<ValidationErrors | null> => {
const hasEmployerCode = this.hasEmployerCodeFormControl.value;
const controlValue: string = control.value;
// Note: see https://stackoverflow.com/questions/36919011/how-to-add-debounce-time-to-an-async-validator-in-angular-2/62662296#62662296
// for explanation of why this is the most correct way to do async validation with debounce
if (hasEmployerCode && controlValue) {
return of(controlValue)
.pipe(
import FileHound from "filehound";
import { promises as fs } from "fs";
import path from "path";
import { promisify } from "util";
//
// const packages = await FileHound.create()
// .paths(`packages`)
// .directory()
// .depth(1)
// .find();
@zihotki
zihotki / PerMinuteInExcessOf.cs
Created August 11, 2022 00:41 — forked from nblumhardt/PerMinuteInExcessOf.cs
Proof of concept rate limiting filter for Serilog
using System;
using Serilog;
using Serilog.Configuration;
namespace ConsoleApplication8
{
static class Program
{
static void Main()
{
@zihotki
zihotki / gist:3881fe398f83dc2097c04f0233e56a9c
Created March 23, 2018 22:16
asp.net core reverse proxy
Install the Add the Microsoft.AspNet.HttpOverrides package
In your Configure() method add
app.UseOverrideHeaders(new OverrideHeaderMiddlewareOptions
{
ForwardedOptions = ForwardedHeaders.XForwardedFor |
ForwardedHeaders.XForwardedProto
});
@zihotki
zihotki / Lighter or Darker a Color.cs
Created December 17, 2017 00:17
.net C# make a color lighter or darker
/// <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
zihotki / ngrxintro.md
Created March 15, 2017 21:31 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

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

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

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

Table of Contents

@zihotki
zihotki / .bash_profile
Created June 4, 2016 16:41
My personal settings for git
alias g=git
alias ls='/bin/ls -F --color=tty --show-control-chars'
alias ga='gitk --all&'
alias gs='git st'
@zihotki
zihotki / RecursiveStack.cs
Created May 31, 2016 21:03
Stack implementation using recursive links
using System;
public class Program
{
public static void Main()
{
var stack = new Stack();
stack.Push(5);
stack.Push(4);
stack.Push(3);