References
View Makefile
bench: | |
go test -bench=. 2>&1 | tee bench.out |
View .inputrc
# Respect extended word-boundaries | |
set bind-tty-special-chars off | |
Control-u: kill-whole-line | |
Control-w: backward-kill-word | |
# Enable Alt- <- -> for jumping by words | |
"\e[1;5D": backward-word | |
"\eOd": backward-word | |
"\e[1;5C": forward-word | |
"\eOc": forward-word |
View delete-activity.js
// 1. Navigate to your Activity Log | |
// 2. Paste this into the JavaScript Console | |
function clickDelete() { | |
document.querySelectorAll('[aria-label="Move to Trash"]')[0].click() | |
} | |
function clickMenu() { | |
document.querySelectorAll('[role="menuitem"]')[2].click(); | |
setTimeout(clickDelete, 250); | |
} |
View Makefile
.PRECIOUS: output.json terraform.tfplan terraform.tfstate | |
output.json: terraform.tfstate | |
terraform output -no-color -json | tee $@ | |
plan: terraform.tfplan | |
terraform.tfplan: | |
terraform plan -out $@ |
View kubectl-extras
#!/bin/zsh | |
# expects https://github.com/ahmetb/kubectl-aliases | |
# implements lots of https://kubernetes.io/docs/reference/kubectl/cheatsheet/ | |
alias kgpos='kgpo --sort-by=.metadata.creationTimestamp' | |
alias kgpoy='kgpo -o yaml' | |
### config view | |
alias kcv='k config' |
View _shellcheck.md
- SC1000 $ is not used specially and should therefore be escaped.
- SC1001 This
\o
will be a regular 'o' in this context. - SC1003 Want to escape a single quote? echo 'This is how it'\''s done'.
- SC1004 This backslash+linefeed is literal. Break outside single quotes if you just want to break the line.
- SC1007 Remove space after = if trying to assign a value (or for empty string, use var='' ... ).
- SC1008 This shebang was unrecognized. ShellCheck only supports sh/bash/dash/ksh. Add a 'shell' directive to specify.
- SC1009 The mentioned parser error was in ...
- SC1010 Use semicolo
View input-validation-example.tf
### Test scenario for "can" | |
variable "word-length" { | |
validation { | |
# The condition here identifies if the integer if greater than 1 | |
condition = var.word-length > 1 | |
error_message = "The variable is not greater than 5. Word length has to be at a minimum > 1." | |
} | |
} |
View variable-input.tf
variable "os" { | |
default = "linux" | |
validation { | |
# The condition here identifies if the variable contains the string "linxu" OR "windows". | |
condition = can(regex("linux|windows", var.os)) | |
error_message = "ERROR: Operating System must be Windows OR Linux." | |
} | |
} |
View try.tf
# Try example | |
data "http" "primary-server" { | |
url = "https://ip-ranges.amazonaws.com/ip-ranges.json" | |
# Optional request headers | |
request_headers = { | |
Accept = "application/json" | |
} | |
} |
NewerOlder