Skip to content

Instantly share code, notes, and snippets.

View benjaminapetersen's full-sized avatar
👾

Ben Petersen benjaminapetersen

👾
View GitHub Profile
authors:
rr: Ryan Richard; richardry
ak: Andrew Keesler; akeesler
mk: Monis Khan; mok
ap: Aram Price; pricear
mm: Matt Moyer; moyerm
mc: Margo Crawford; margaretc
email:
domain: vmware.com
global: true
[core]
# pager = delta
[interactive]
# diffFilter = delta --color-only
[delta]
side-by-side = true
#syntax-theme = Dracula
# Generated by Powerlevel10k configuration wizard on 2020-09-12 at 21:53 PDT.
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 49789.
# Wizard options: nerdfont-complete + powerline, small icons, classic, unicode, dark,
# 12h time, angled separators, sharp heads, flat tails, 2 lines, disconnected, no frame,
# compact, many icons, concise, transient_prompt, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate
# your own config based on it.
#
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export PATH=$HOME/go/bin:$PATH
# On linux also add the path to brew and a place to put chromedriver...
if [[ "$OSTYPE" != "darwin"* ]]; then

Laptop Setup Tips

Moving from an older laptop? Bring these files over.

  • In Safari, "File -> Export -> Bookmarks"
  • Make a copy of ~/.zsh_history
  • Make a copy of github public and private keys from ~/.ssh or wherever you kept them
  • Check your Downloads folder for anything worth keeping

Helpful Brew Casks

@benjaminapetersen
benjaminapetersen / jsonpath.md
Created May 27, 2022 20:05 — forked from navicore/jsonpath.md
for getting multiple fields from kubectl via jsonpath

get name and image and startTime

kubectl get pods -ao jsonpath='{range .items[*]}{@.metadata.name}{" "}{@.spec.containers[*].image}{" "}{@.status.phase}{" "}{@.status.startTime}{"\n"}{end}'| grep track
#!/usr/bin/env bash
VERSION="$1"
VERSION="${VERSION#[vV]}"
VERSION_MAJOR="${VERSION%%\.*}"
VERSION_MINOR="${VERSION#*.}"
VERSION_MINOR="${VERSION_MINOR%.*}"
VERSION_PATCH="${VERSION##*.}"
echo "Version: ${VERSION}"
@benjaminapetersen
benjaminapetersen / trap_focus.js
Created December 17, 2020 22:26 — forked from myogeshchavan97/trap_focus.js
Code for trapping focus inside modal
// add all the elements inside modal which you want to make focusable
const focusableElements =
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
const modal = document.querySelector('#exampleModal'); // select the modal by it's id
const firstFocusableElement = modal.querySelectorAll(focusableElements)[0]; // get first element to be focused inside modal
const focusableContent = modal.querySelectorAll(focusableElements);
const lastFocusableElement = focusableContent[focusableContent.length - 1]; // get last element to be focused inside modal
@benjaminapetersen
benjaminapetersen / 1-setup.md
Created July 21, 2020 20:35 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or Krypt.co.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Content-Security-Policy</title>
<meta name="viewport" content="width=device-width">
<meta http-equiv="Content-Security-Policy"
content="default-src 'self' data: gap: 'unsafe-eval' ws: ;
style-src 'self' 'unsafe-inline';
script-src https: *.example.com ;