Skip to content

Instantly share code, notes, and snippets.

@postazure
postazure / pairing.zsh-theme
Created June 12, 2019 20:35
oh-my-zsh theme that includes the git authors from git-duet
# Save me here -> ~/.oh-my-zsh/themes/pairing.zsh-theme
# Git Authors
prompt_git_name() {
if $(git config --get duet.env.git-author-name >/dev/null 2>&1); then
prompt_git_duet_name
else
prompt_git_normal_name
fi
}
@postazure
postazure / ResetAllMocksInContextExtension.kt
Created February 5, 2019 21:43
Reset JUNIT5 MockBeans in BeforeEach
class ResetAllMocksInContextExtension : BeforeEachCallback {
override fun beforeEach(context: ExtensionContext?) {
val testInstance = context!!.testInstance.get()
val testContext = getAccessibleContext(testInstance)
resetMocksInContext(testContext)
}
private fun getAccessibleContext(testInstance: Any): Any? {
@postazure
postazure / .zshrc
Last active June 14, 2019 21:10
zshell config
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/pivotal/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@postazure
postazure / uuid.sh
Created October 15, 2018 19:06
UUID generating script that also places the uuid in the clipboard
uuid () {
UUID=$(uuidgen) && echo $UUID | pbcopy && echo $UUID
}
@postazure
postazure / .bash_prompt
Created July 4, 2018 09:48
Simple Git Bash Prompt
BLUE="$(tput setaf 4)"
GREEN="$(tput setaf 2)"
ORANGE="$(tput setaf 3)"
RED="$(tput setaf 1)"
RESET="$(tput sgr0)"
git_prompt(){
if [ -d .git ]; then
IS_GIT_REPO=true
else
@postazure
postazure / lead-dev-nyc.md
Created April 27, 2018 15:42
Lead Dev NYC 2018 Conference Notes

Revitalizing a cross-functional product organizations

Team health velocity strategic execution

wherewithall.com

  1. Clarify roles and responsibilities What are they responsible for and how that fits in to the broader org. Ambiguity breads frustration.
@postazure
postazure / lp_copy_ssh.sh
Last active November 9, 2017 17:01
Copy ssh key from lastpass to a machine for a short amount of time
#!/usr/bin/env bash
# This script temporarily adds an ssh key until the end of the working day, from Lastpass.
# Requires the lastpass cli, if you don't have it, install with `brew install lastpass-cli --with-pinentry`
# Store rsa_id in a note in lastpass called 'rsa_id' in a folder called 'Github'.
#
# Usage:
# add_key [hours]
#
# hours Specifies the number of hours to add the ssh key. Overrides the default end of day behavior.
@postazure
postazure / redis-filler.rb
Created January 3, 2017 19:45
Fill Redis Database with Junk
#!/usr/bin/env ruby
require "redis"
require "securerandom"
if ARGV.length != 4
puts "redis-filler.rb password url port mb"
exit 1
end
@postazure
postazure / StrangeLoop2016Notes.md
Last active September 20, 2016 17:05
Strange Loop 2016 Notes

#StrangeLoop2016 all videos

Simplified Code

video

Program Slicing

Fixing bugs have diminishing returns. There is a one time cost, barrier to entry, to fixing bugs in dependencies. How do you make it easier to read and understand your dependencies?

Docs are perpetually out of date, source code is never out of date for describing what it does.

@postazure
postazure / PostgreSQL_Training_Notes.md
Created April 27, 2016 21:27
PostgreSQL Training Notes

##Config ###Recovery Mode (Single User Mode, --single)

  • no network
  • skips auth

###About pstgresql.conf <- Base Config pstgresql.auto.conf <- Overrides base config

  • Set with ALTER SYSTEM 9.4+