...
...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } | |
); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if (Confirm-Operation -Message 'Really do the thing?') { | |
# Get-ChildItem | Remove-Item -Recurse -Force | |
# } | |
function Confirm-Operation { | |
param( | |
$Caption = '', | |
$Message = '', | |
$AffirmOption = '', | |
$AffirmDescription = '', |
$ 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
var stamp = Hashcash.Parse("1:24:040806:foo::511801694b4cd6b0:1e7297a") | |
if (Hashcash.IsValid(stamp)) { | |
// ... | |
} | |
``` |
$ mkdir -p ~/.local/var/az-cli-client42
$ az client42 login
$ az client42 resource list
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>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# User mode service for ssh-agent -- set the environment variables | |
SSH_AGENT_PID=$(systemctl --user show ssh-agent.service | grep ^MainPID= | cut -d= -f2) | |
if [ "0" = "${SSH_AGENT_PID}" ]; then | |
systemctl --user restart ssh-agent.service | |
SSH_AGENT_PID=$(systemctl --user show ssh-agent.service | grep ^MainPID= | cut -d= -f2) | |
fi | |
export SSH_AGENT_PID | |
export SSH_AUTH_SOCK="/run/user/$(id -u)/openssh_agent" |