λ set BITBUCKET_USERNAME=me
λ set BITBUCKET_PASSWORD=secret
λ buildmins org/repo
42
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
ls -dir | % { | |
cd "$_" | |
write-host "~ $_" -foregroundcolor magenta | |
git pull | |
cd .. | |
} | |
<# | |
PS dir> .\pull-all.ps1 | |
~ subdir1 |
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
(docker ps -q -a).split('\n') | % { docker rm $_ } | |
(docker images -q -a).split('\n') | % { docker rmi $_ } |
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
get-dnsclientserveraddress | | |
where { $_.InterfaceAlias -like "*(DockerNAT)" } | % { | |
set-dnsclientserveraddress ` | |
-interfaceindex $_.InterfaceIndex ` | |
-serveraddresses @("8.8.8.8", "8.8.4.4") | |
} |
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
@echo off | |
powershell -f %~dp0hosts.ps1 %1 %2 %3 |
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
@echo off | |
:: print help | |
if "%~1" == "--help" ( | |
type %~dp0setvar.txt | |
) else ( | |
:: assign output of command to env var | |
for /f "delims=" %%i in ('%~2') do set %~1=%%i |
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
kubectl get nodes -o json | jq ".items[] | {name: .metadata.name, conditions: [.status.conditions[] | {type: .type, status: .status}]}" |
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
document.body.animate( | |
[ | |
'translateX(-6px)', | |
'translateX(12px)', | |
'translateX(-9px)', | |
'translateX(15px)', | |
'translateX(-6px)', | |
] | |
.map(transform => ({ transform })), | |
{ |
If you have cmd
open two times, and you wanna use the same directory in both sessions:
- Type
cd | clip
in the first one. - Then
alt+tab
to the second one. - Type
cd
and hitctrl+v
.
And you're done (you don't even need to hit enter
anymore).
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
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
TEMPLATE='{range .items[*]}{.metadata.name}{";"}{end}' | |
DEPLOYMENTS=$( | |
kubectl get deployments --output="jsonpath" --template="$TEMPLATE" \ |