Skip to content

Instantly share code, notes, and snippets.

View mikhey's full-sized avatar

Micah Miller mikhey

  • Pennsylvania, USA
View GitHub Profile
@davidfowl
davidfowl / .NET6Migration.md
Last active April 11, 2024 02:02
.NET 6 ASP.NET Core Migration

Frappe - Creating a Custom Application & Integrating it with ERPNext

Exercise create a total weight field in erpnext Sales Order

Custom Application

create new app

$ bench new-app erpnext_shipping
INFO:bench.app:creating new app erpnext_shipping
@machuu
machuu / WSL2_VPN_Workaround_Instructions.md
Last active May 15, 2024 14:11
Workaround for WSL2 network broken on VPN

Overview

Internet connection and DNS routing are broken from WSL2 instances, when some VPNs are active.

The root cause seems to be that WSL2 and the VPN use the same IP address block, and the VPN routing clobbers WSL2's network routing.

This problem is tracked in multiple microsoft/WSL issues including, but not limited to:

@mkfares
mkfares / zsh-keyboard-shortucts.md
Last active May 13, 2024 19:25
Common zsh Keyboard Shortcuts on macOS Catalina

Common zsh Keyboard Shortcuts on macOS

Navigation

CTRL + A : Move the cursor to the beginning of the line
CTRL + E : Move the cursor to the end of the line
OPTION + Left Arrow : Move the cursor one word backward
OPTION + Right arrow : Move the cursor one word forward
Left Arrow : Move the cursor one character backward
Right Arrow : Move the cursor one character forward

@gwalkey
gwalkey / gist:c6d889884c3bb4a835c99f65b4d39ab6
Last active October 26, 2021 16:09
Powershell Anonymous Lamda for Retry with Exponential Backoff
# https://vexx32.github.io/2018/10/26/Anonymous-Functions/
function Retry()
{
param(
[Parameter(Mandatory=$true)][Action]$action,
[Parameter(Mandatory=$false)][int]$maxAttempts = 3
)
$attempts=1
@AlbertoDePena
AlbertoDePena / Serilog.fs
Last active January 21, 2023 00:06
FSharp logger with Serilog (app insights and console sinks)
// NuGet Packages
// Serilog.Enrichers.Environment
// Serilog.Sinks.ApplicationInsights
// Serilog.Sinks.Console
open System
open Serilog
open Serilog.Events
[<RequireQualifiedAccess>]
@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
@swlaschin
swlaschin / FsCsInterop.md
Last active May 6, 2024 17:20
F# to C# interop tips

Tips on exposing F# to C#

Api and Methods

I suggest that you create one or more Api.fs files to expose F# code in a C# friendly way.

In this file:

  • Define functions with PascalCase names. They will appear to C# as static methods.
  • Functions should use tuple-style declarations (like C#) rather than F#-style params with spaces.
@Swimburger
Swimburger / CrawlSite.ps1
Last active June 27, 2023 22:24
Crawl your website links and images to find broken links/images using PowerShell
Param(
[Parameter(Mandatory=$true)]
[string] $Url,
[Parameter(Mandatory=$true)]
[int] $MaxPages,
[bool] $IncludeImages = $true,
[bool] $StayOnDomain = $true,
[bool] $IgnoreFragments = $true)
Add-Type -AssemblyName System.Web
@chgeuer
chgeuer / jwt_ms.html
Created November 23, 2018 07:03
jwt.ms
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jwt.ms: Welcome!</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
<style>
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700");html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline