Skip to content

Instantly share code, notes, and snippets.

View tlcowling's full-sized avatar

Thomas Cowling tlcowling

View GitHub Profile
@tlcowling
tlcowling / q.sh
Created April 14, 2021 11:16
Fuzzy choose kubectl context
#!/usr/bin/env bash
set -o errexit
export CTX_CHOICE="$(kubectl config get-contexts --no-headers=true -o name | pick)"
echo "You chose ${CTX_CHOICE}"
kubectl config set-context "${CTX_CHOICE}"

Keybase proof

I hereby claim:

  • I am tlcowling on github.
  • I am tlcowling (https://keybase.io/tlcowling) on keybase.
  • I have a public key ASAFKhlM9a-UDQjTqOdV-EykQphuRSp_g6zw_ZG1eWhiOwo

To claim this, I am signing this object:

ldapsearch -LLL -x -Dcn='Directory Manager' -w doitjustdoitdontletyourdreamsbedreams -b 'cn=computers,cn=accounts,dc=bobcat,dc=cowling,dc=local' "nsds5ReplConflict=*" \* nsuniqueid
@tlcowling
tlcowling / promises_example.js
Created June 25, 2015 22:08
Heres an example usage of native promise from ECMAScript 6, here are multiple async calls
var bcrypt = require('bcryptjs');
var fs = require('fs');
// First promise we'll create will be an asynchronous call to bcrypt to hash a password
// note the callback function and the use of resolve and reject
var promise = new Promise(function(resolve, reject) {
bcrypt.hash('password', 10, function(err, hash) {
if(hash) {
resolve(hash);
} else {