Skip to content

Instantly share code, notes, and snippets.

View mdorr's full-sized avatar

Maurice Dorrin mdorr

  • AWS
  • PHL
View GitHub Profile
# Delete all pods from all namespaces stuck in 'Pending' phase
kubectl get pods -A --field-selector 'status.phase=Pending' -o name | xargs kubectl delete
kubectl get pods -A | grep Pending | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
@mdorr
mdorr / solarized_dark_with_red_cursor.itermcolors
Created October 21, 2020 15:19
iTerm2 Color scheme: Solarized dark with red cursor
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.25882354378700256</real>
@mdorr
mdorr / developer_tips_and_tricks.md
Last active April 23, 2020 16:03
Developer Tips and Tricks
@mdorr
mdorr / k8s_command_args.md
Last active April 9, 2020 16:43
Kubernetes command & args with shell substitution

If trying to pass a startup command with env substitution to the command/args fields in a kubernetes yml file, don't try to use substituition in the arguments as you normally would - that will be parsed differently. Instead, make your life easier by using /bin/sh -c like in this example:

command: ["/bin/sh"]
args: ["-c", "pg_dump -v -U ${DATABASE_USER} -h ${DATABASE_HOST} ${DATABASE_NAME} > /db-backup/$(date +'%Y-%m-%d_%H-%M-%S')_${DATABASE_NAME}.backup.sql"]
@mdorr
mdorr / calling_a_function.js
Created November 18, 2016 02:46
Different ways of calling a function in JS
// Method style - 'this' is the object that the method is being called on
object.method(parameters)
this = object
// Function style: this is the global, or window object
method(parameters)
this = global/window
// Constructor style: this is the object that is being created by the constructor
instance = new Object(parameters)
@mdorr
mdorr / inferred_semicolons_2.js
Created November 17, 2016 02:40
Fix to ensure missing semicolons are inferred correctly
var x
a = b
;(f()) // Note leading semicolon
// It will now parse correctly:
var x;
a = b;
(f());
@mdorr
mdorr / inferred_semicolons.js
Last active November 17, 2016 02:36
Inferred Semicolons in JavaScript
// Consider these statements:
a = b
var x
(f())
// JavaScript will correctly infer semicolons and parse as:
a = b;
var x;
(f());