Skip to content

Instantly share code, notes, and snippets.

View pielegacy's full-sized avatar

Alex Billson pielegacy

  • Mecca Brands
  • Melbourne, Australia
  • 22:02 (UTC -12:00)
View GitHub Profile
@pielegacy
pielegacy / VariousOpinionsOnProgramming.md
Last active January 7, 2024 06:59
Various opinions on programming

My Various Programming Opinions

These aren't supposed to be hot takes as most of these are pretty lukewarm and things that for the majority people follow anyway, thought it would be nice to have them all in one place.

Loops vs Functional Array Methods

I like to use loops where possible with functional array methods (not sure what the best terminology for it is but in JS it's stuff like map, reduce, filter and in C# it's Where, Select etc...).

The design of these array methods is to follow very standard functional programming concepts so methods such as a .ForEach where nothing is returned from these iterations always bug me.

@k-amin07
k-amin07 / VFIO.md
Last active July 20, 2024 08:25
VFIO Guide for GPU Passthrough

Introduction:

This guide is for achieving PCI-Passthrough with Intel 7700k and AMD RX 580. My host OS is Manjaro KDE edition, and guest is Windows 10.

Hardware:

Device Type Device
CPU Intel Core i7-7700K
Motherboard ASUS Prime Z270P
RAM Corsair Vengeance (DDR4 3000 MHz)
GPU (Host) Intel HD Graphics
@hyrmn
hyrmn / DapperExtensions.cs
Last active December 18, 2023 09:16
Extension methods for calling Dapper asynchronously with a Polly retry
public static class DapperExtensions
{
private static readonly IEnumerable<TimeSpan> RetryTimes = new[]
{
TimeSpan.FromSeconds(1),
TimeSpan.FromSeconds(2),
TimeSpan.FromSeconds(3)
};
private static readonly AsyncRetryPolicy RetryPolicy = Policy
@DanDiplo
DanDiplo / JS-LINQ.js
Last active July 19, 2024 03:02
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },