Skip to content

Instantly share code, notes, and snippets.

@maxwellb
maxwellb / code-insiders.desktop
Last active October 16, 2019 22:43
Visual Studio Code - Insiders -- Download and Update scripts for Debian
# Copyright (c) 2019 Maxwell Bloch, MIT license
[Desktop Entry]
Type=Application
Name=Code - Insiders
Version=1.1
GenericName=IDE
Icon=code-insiders
Exec=/usr/bin/code-insiders %F
Terminal=false
StartupWMClass=Code - Insiders
@maxwellb
maxwellb / 0 Python venv wrapper.md
Last active August 29, 2019 18:42
Universal Python venv wrapper
$ ln -s /opt/work/my-env/../../../usr/local/bin/within-venv.sh /opt/within-my-venv && ln -s /opt/within-my-venv /usr/local/bin/mytool
$ mytool     # runs in /opt/work/my-venv
@maxwellb
maxwellb / 0 debootstrap chroot.md
Last active July 25, 2019 23:34
Wrapper to debootstrap and chroot

...

@maxwellb
maxwellb / 0 powershell docker wrapper.md
Last active August 29, 2019 19:03
PowerShell docker wrapper to a Hyper-V VM
PS C:\tmp> invoke-vmssh -command "uname -a" -username $env:defaultVmUser -vmname $env:defaultVmName
Linux debianvm 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5+deb10u2 (2019-08-08) x86_64 GNU/Linux
PS C:\tmp> docker info | grep Server
Server Version: 18.09.1
PS C:\tmp>
@maxwellb
maxwellb / 0 az-cli wrapper.md
Last active August 29, 2019 18:49
docker az-cli wrapper for .bashrc
$ mkdir -p ~/.local/var/az-cli-client42
$ az client42 login
$ az client42 resource list
@maxwellb
maxwellb / 0 PowerShell Snippets.md
Created April 4, 2019 11:10
PowerShell Snippets

...

@maxwellb
maxwellb / 0 Gentoo-Prefix chroot for Chrome OS
Last active April 1, 2019 22:56
Gentoo-Prefix chroot for Chrome OS
...
@maxwellb
maxwellb / 0 Hashcash.NET
Last active August 29, 2019 18:47
Hashcash.NET
```
var stamp = Hashcash.Parse("1:24:040806:foo::511801694b4cd6b0:1e7297a")
if (Hashcash.IsValid(stamp)) {
// ...
}
```
@maxwellb
maxwellb / 0 NodeJS-bash starter scripts
Last active January 23, 2019 19:19
NodeJS/bash starter scripts
...
@maxwellb
maxwellb / propsApply.ts
Last active August 29, 2019 18:14
propsApply.ts
export default function propsApply<TIn, TOut>(_: { [index: string]: TIn }, fn: { (source: TIn): TOut }) {
return Object.keys(_).reduce(
(result, i) => {
result[i] = fn(_[i]); return result;
},
{} as { [any: string]: TOut }
);
};