Skip to content

Instantly share code, notes, and snippets.

View joerohde's full-sized avatar

Joe Rohde joerohde

View GitHub Profile
@joerohde
joerohde / cds.btm
Last active December 22, 2021 21:35
TakeCommand improved cd / cdd command
@echo off
setlocal
rem arbitrary max directories to show
set MAX=32
setarray directories[%MAX]
setarray searchResults[%MAX]
rem used to set value that conveniently escapes setlocal
setarray __CD[1]
@joerohde
joerohde / vscode.sh
Last active May 1, 2022 19:15
Runs Visual Studio Code when using remote explorer connection
#!/bin/bash
SCRIPT=$(basename "$0")
# options
parents_only=
all_users=
verbose=
grep_expr='/.+?vscode-server.*?[[:xdigit:]]{32,64}/bin/'
# working state
@joerohde
joerohde / ReactMixinFail.ts
Last active June 30, 2020 17:48
Mostly eslint typesafe mixin to add functionality to React.Component and React.PureComponent - doesn't quite work
// With paranoid eslint type specs.
//
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type ReactMixinMasterMaker<C> = new (...args: any[]) => C; // ES2015 mixin 'pattern' constructor form
// We are making a 'ReactWrapper' class that extends a constructor that produces type T
// where T implements at least the signature of React.Component. The 'type' _ReactWrapper
// would normally be left off as it is very cumbersome to produce if strict type definitions are not required.
function ReactWrapper<T extends ReactMixinMasterMaker<React.Component>>(Base: T): typeof _ReactWrapper {
// The actual 'Wrapper' class we want to create, with a base class Base of type T
Functionality is now on the iTerm2 site:
https://iterm2.com/utilities/it2check