about summary refs log tree commit diff
path: root/users/riking/dotfiles/.mybashrc
blob: c5ebc34a1f4f9f43b159a33c50b37ff9320cca96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

# BEGIN: __USER_FUNCTIONS__
function gh-clone() {
	if [[ "x$2" == "x" ]]; then
		IFS='/' read -ra PARTS <<< "$1"
		user="${PARTS[0]}"
		repo="${PARTS[1]}"
	else
		user="$1"
		repo="$2"
	fi
	if [[ -d ~/go/src/github.com/"$user"/"$repo" ]]; then
		cd ~/go/src/github.com/"${user}"/"${repo}"
		return 0
	fi
	mkdir -p ~/go/src/github.com/"${user}"
	cd ~/go/src/github.com/"${user}"
	git clone git@github.com:"${user}"/"${repo}".git
	cd ~/go/src/github.com/"${user}"/"${repo}"
}

function download() {
	cd "${HOME}/Downloads"
	wget "$@"
}

# todo: only one password pls
function prodaccess() {
	(ssh-add -L | grep -q 'ZgEu6S3SLatYN') || ssh-add "$HOME"/.ssh/id_ed25519
	(ssh-add -L | grep -q 'Gfh2S3kUwZ8A6') || ssh-add "$HOME"/.ssh/id_rsa.discourse
	echo "signing test" | gpg --clearsign > /dev/null
}

function reset-audio() {
	pulseaudio -k && sudo alsa force-reload
}

function tvl-push() {
	git push origin HEAD:refs/for/canon
}

# END: __USER_FUNCTIONS__

# BEGIN: __USER_ENV__
GOPATH=$HOME/go
CDPATH=$HOME/go/src
export GPG_TTY="$(tty)"

export PATH="/usr/local/go/bin:$HOME/go/bin:$HOME/.rbenv/bin:$PATH"

eval "$(rbenv init -)"
# END: __USER_ENV__