Skip to content

Instantly share code, notes, and snippets.

View jennings's full-sized avatar
🦄
What a mess I've made

Stephen Jennings jennings

🦄
What a mess I've made
View GitHub Profile
@jennings
jennings / Makefile
Created May 14, 2021 16:55
Makefile syntax to run different commands on Windows. Works with GNU Make, not NMake
target:
ifeq ($(OS),Windows_NT)
powershell -NoProfile -Command "Get-Date"
else
date
endif
@jennings
jennings / File0.txt
Last active July 29, 2022 16:32
Testing the order that gists sort files. It seems to be first case-insensitively, then case-sensitively. And the title is the first file in ASCII order.
a
using System;
using System.Threading.Tasks;
using MassTransit;
namespace mttest
{
class Program
{
static async Task Main(string[] args)
{
@jennings
jennings / IISExpressCannotBindToExcludedPort.
Last active March 25, 2021 21:17
IIS Express claiming it cannot bind to a port, even though Node is able to without a problem
C:\Program Files\IIS Express
>
PS>netsh int ipv4 show excludedportrange tcp | sls 63300 # I have manually added 63300-63399 as an exclusion
63300 63399 *
C:\Program Files\IIS Express
>
PS>netstat -ano | sls 63325 # Nothing is bound to 63325 right now
<#
Burns a timecode into a video using ffmpeg.
#>
param(
$Path,
$OutFile,
$Rate
)
@jennings
jennings / 1_Relational_text_processing.md
Last active December 7, 2020 16:08
Unix relational text processing

sort

Sorts on a column.

$ sort makes.txt
1 volkswagen
2 honda
3 ford

Fundamental Principle

Systems in general work poorly or not at all.

First Principles

  1. New Systems mean new problems.
  2. The total amount of anergy in the universe is fixed.
  3. Systems tend to expand to fill the known universe.

Download PuTTY

Download and install the latest 64-bit PuTTY. Using the MSI is fine.

Generate an SSH key

Each computer should a unique SSH key. The same key can be reused for GitHub, Bitbucket, and any other Git server you connect to.

  1. Launch PuTTYgen:
  2. Select "Ed25519"
function Caffeinate {
param([scriptblock]$ScriptBlock)
$active_scheme_id = (powercfg /GetActiveScheme).Split(" ")[3]
$high_perf_id = "8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"
powercfg /s $high_perf_id
if ($LASTEXITCODE -ne 0) { return }
try {
& $ScriptBlock
} finally {
@jennings
jennings / rx-net-vs-rxjs.md
Last active December 19, 2019 19:43
A cheatsheet of Rx.NET to rxjs operators

Creation

System.Reactive rxjs 6
Observable.Return import { of } from "rxjs"
Observable.Empty import { EMPTY } from "rxjs"
Observable.Never import { NEVER } from "rxjs"
Observable.Throw import { throwError } from "rxjs"
Observable.Create new Observable(observer => {})
Observable.Range import { range } from "rxjs"