Skip to content

Instantly share code, notes, and snippets.

View cajuncoding's full-sized avatar
💭
Released RepoDb.SqlServer.PagingOperations for Cursor Paging w/ SQL Server

Brandon cajuncoding

💭
Released RepoDb.SqlServer.PagingOperations for Cursor Paging w/ SQL Server
View GitHub Profile
@tristanlins
tristanlins / Date.toW3CString.js
Last active February 29, 2024 19:44
Date.toW3CString() method to convert date objects into W3C date time format: yyyy-mm-ddThh:ii:ss+zz:zz
/**
* Convert a Date object to a string, according to W3C date time format: yyyy-mm-ddThh:ii:ss+zz:zz
*
* @memberOf Date
* @access public
* @license MIT
* @copyright 2013 Tristan Lins
* @author Tristan Lins <tristan.lins@bit3.de>
* @link https://gist.github.com/tristanlins/6585391
*/
@deergod1
deergod1 / pfSense config.md
Last active April 5, 2023 10:39
pfSense Easy Configuration Guide for HP t620 Plus

pfSense Simple Home Configuration - 2.4.3 / 2.4.4

Starting from Scratch

This is my personal guide for installing pfSense. Hope you find it useful. I made these notes to capture the details of my "install from scratch" to ensure I didn't miss important details. Also, I'm trying build my network with discrete "disposable" components that make the system mutable and less rigid. It does not cover installing any packages like Squid or Suricata as that's way beyond the scope of a basic, functional install.

I migrated from an environment that was at various times running Tomato Toastman 1.28 or Asuswrt-Merlin on Netgear and ASUS routers across four "access points" (one always acting as the firewall/gateway, the rest as APs). It was OK pre-gigabit, but had roaming problems, and I was using large Wifi routers with most of the features disabled. Also, I found that I could easily swamp the network and tank VOIP and Wifi Calling without even trying. The only fix was to throttle everything by using Bandwidth Limit

@wingrime
wingrime / backoff.cs
Created May 27, 2019 08:59
C# exponential backoff
public static class Retry
{
public static async Task<T> DoAsync<T>(Func<Task<T>> action,
Func<T, bool> validateResult = null,
int maxRetries = 10, int maxDelayMilliseconds = 2000, int delayMilliseconds = 200)
{
var backoff = new ExponentialBackoff(delayMilliseconds, maxDelayMilliseconds);
var exceptions = new List<Exception>();
@dolphinspired
dolphinspired / FunctionContextAccessor.md
Last active May 30, 2024 16:50
FunctionContextAccessor example

IFunctionContextAccessor Implementation

This is a brief tutorial on how to create a dependency-injectable FunctionContext accessor for Azure Functions running on the dotnet-isolated runtime (.NET 5 and up). This will work very similarly to IHttpContextAccessor - it will allow you to access details about the current Function invocation and pass arbitrary values between injected services that are scoped to this invocation.

  1. Create your interface. You must include both get and set on this interface.
public interface IFunctionContextAccessor
{
 FunctionContext FunctionContext { get; set; }