Skip to content

Instantly share code, notes, and snippets.

@tchupp
tchupp / aa-fun.bats
Created October 3, 2024 14:33
associative arrays + bats
setup() {
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
}
teardown() {
true
}
set -euo pipefail
@tchupp
tchupp / new_macbook_setup.md
Last active April 13, 2022 19:20
New Macbook Set Up
@tchupp
tchupp / agnoster.zsh-theme
Last active April 19, 2022 12:59
~/.oh-my-zsh/themes/agnoster.zsh-theme
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline

Keybase proof

I hereby claim:

  • I am tchupp on github.
  • I am theochupp (https://keybase.io/theochupp) on keybase.
  • I have a public key whose fingerprint is EC53 90C9 8812 D49B 34AB 12AA D106 461E 770A B141

To claim this, I am signing this object:

@tchupp
tchupp / 3x3
Last active October 29, 2022 23:59
Rubix cube
## Symbols
U: up (top)
B: bottom
L: left
R: right
F: front
F <- rotate front clockwise
F' <- rotate front counter-clockwise
@tchupp
tchupp / PartialApplicationWithClass.kt
Created July 9, 2018 19:16
Kotlin partial application for dependency injection
class DeviceConfigurationAdapter(
private val retrofit: Retrofit,
private val client: DeviceConfigurationClient,
private val authHeader: String
) : (DeviceIdentity) -> Either<DeviceConfigurationError, Device> {
override fun invoke(identity: DeviceIdentity): Either<DeviceConfigurationError, Device> {
val request = DeviceConfigurationRequest(identity.id, identity.certificate.asX509Pem())
return client.getDeviceConfiguration(request, authHeader)
@tchupp
tchupp / go_closer
Created February 25, 2018 18:19
Close many sources - Golang
package closer
import "github.com/hashicorp/go-multierror"
type Closer interface {
Close() error
}
func CloseMany(closers ...Closer) error {
var result *multierror.Error
div.pipeline-wrapper {
position: relative;
background-color: transparent !important;
padding: 10px;
}
.PENDING, .MANUAL {
background-color: #00bcd4;
color: #222;
}
@tchupp
tchupp / iterm2-solarized.md
Created July 21, 2016 01:26 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OS X / macOS)

Solarized