-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
241 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "github-cctray"] | ||
path = github-cctray | ||
url = [email protected]:robotdana/github-cctray.git | ||
[submodule "monokai.terminal"] | ||
path = monokai.terminal | ||
url = [email protected]:robotdana/monokai.terminal.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ xcode-select --install | |
git clone [email protected]:robotdana/dotfiles.git ~/.dotfiles | ||
~/.dotfiles/scripts/install.sh | ||
change the computer name | ||
set Terminal.app to bash | ||
sign in to 1pass | ||
copy istatmenus config from 1pass | ||
sign in to everything else | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
. ~/.dotfiles/functions/color | ||
PATH="~/.dotfiles/bin:$PATH" | ||
|
||
export PS2="\[$COLOR_PINK\]» \[$COLOR_RESET\]" | ||
export PS1="\[\$(last_command_style)$COLOR_PINK\]\w\$(prompt_version)\[\$(prompt_git_color)\]\$(prompt_git)$PS2" | ||
export GPG_TTY=$(tty) | ||
export PS2='\[\033[2K\r$(prompt_base_style)\]> \[\033]0m\]' | ||
export PS1='\[\033[2K\r$(prompt_base_style)\]\w\[\033[38;5;205m\]$(prompt_version)\[$(prompt_git_color)\]$(prompt_git)\[\033[38;5;199m\]> \[\033[0m\]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# modified from https://askubuntu.com/a/279014 | ||
for background in 49 40 41 42 43 44 45 46 47; do | ||
echo -ne "\033[${background}m \033[0m" | ||
done | ||
echo | ||
for style in 22 '1' '2'; do | ||
for foreground in 39 30 31 32 33 34 35 36 37; do | ||
for background in 49 40 41 42 43 44 45 46 47; do | ||
echo -ne "\033[${style};${foreground};${background}m $((( style < 10 )) && echo ' ')${style};${foreground};${background} \033[0m" | ||
done | ||
echo | ||
done | ||
for background in 49 40 41 42 43 44 45 46 47; do | ||
echo -ne "\033[${background}m \033[0m" | ||
done | ||
echo | ||
done | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo -n $COLOR_GREY"COVERAGE=1 MIN_COVERAGE=100 "$COLOR_RESET | ||
echo -n $'\033[0;2m'COVERAGE=1 MIN_COVERAGE=100 | ||
COVERAGE=1 MIN_COVERAGE=100 rt "$@" || echodo open coverage/index.html |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo_color AQUA run: "$@" | ||
echo $'\033[36m'run: "$@"$'\033[0m' | ||
false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
str="$COLOR_GREY" | ||
space='' | ||
for string in "$@"; do | ||
str="$str$space" | ||
|
||
if [[ -z "$string" ]]; then | ||
str="$str''" | ||
elif [[ "$string" =~ \'|\"|\ |\&|\{|\}|\(|\)|\[|\]|\$|\<|\>|\||\;|$'\n' ]]; then | ||
if [[ "$string" =~ \' ]]; then | ||
str="$str"\""${string//\"/\\\"}"\" | ||
else | ||
str="$str"\'"$string"\' | ||
fi | ||
else | ||
str="$str$string" | ||
fi | ||
|
||
space=" " | ||
done | ||
|
||
echo -e "$str\033[0m" >&2 | ||
echodont "$@" | ||
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
str=$'\033[0;2m' | ||
space='' | ||
for string in "$@"; do | ||
str="$str$space" | ||
|
||
if [[ -z "$string" ]]; then | ||
str="$str''" | ||
elif [[ "$string" =~ \'|\"|\ |\&|\{|\}|\(|\)|\[|\]|\$|\<|\>|\||\;|$'\n' ]]; then | ||
if [[ "$string" =~ \' ]]; then | ||
str="$str"\""${string//\"/\\\"}"\" | ||
else | ||
str="$str"\'"$string"\' | ||
fi | ||
else | ||
str="$str$string" | ||
fi | ||
|
||
space=" " | ||
done | ||
|
||
echo -e "$str"$'\033[0m' >&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo_color RED error: "$@" >&2 | ||
echo $'\033[31m'error: "$@"$'\033[0m' >&2 | ||
false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
# `gbf <filename> [<base branch>]` git branch file | ||
# shows commits modifying <filename> since this branch forked from <base_branch> or main branch. | ||
# `gbf <filename>` git branch file | ||
|
||
filename=$1; | ||
base_branch=${2:-"$(git_main_base_branch)"}; | ||
echodo git log --oneline --follow --patch $(git_log_range "$base_branch") -- "$filename" | ||
git_log_oneline_new --follow --patch -- "$filename" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ ! -z "$1" ]] && git rev-parse --verify -q "$1" >/dev/null 2>/dev/null; then | ||
echo $1 | ||
else | ||
false | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
git rev-parse --symbolic-full-name --abbrev-ref ${1:-HEAD} 2>/dev/null | ||
git rev-parse --verify --symbolic-full-name --abbrev-ref=strict ${1:-HEAD} 2>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
[[ "$(git rev-parse @{u} 2>/dev/null)" == "$(git rev-parse HEAD 2>/dev/null)" ]] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
# git_main_remote_branch >/dev/null 2>&1 # ensure we have origin/HEAD and upstream/HEAD if we should | ||
git --no-pager log --color --reverse --format='%h%Creset%(decorate) %s %C(dim)%cr - %cn%Creset' "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/usr/bin/env ruby --disable-all | ||
|
||
if ARGV.delete('--off') | ||
while gets | ||
puts $_ | ||
end | ||
exit 0 | ||
end | ||
|
||
def branch_exist?(branch) | ||
( | ||
@branch_exist ||= Hash.new do |hash, key| | ||
hash[key] = key && !`git_branch_if_exist #{key}`.chomp.empty? | ||
end | ||
)[branch] | ||
end | ||
|
||
def main_branch | ||
@main_branch ||= `git_main_branch`.chomp | ||
end | ||
|
||
def current_branch | ||
@current_branch ||= `git_branch_name`.chomp | ||
end | ||
|
||
def current_branch_main? | ||
main_branch == current_branch | ||
end | ||
|
||
$forks = { | ||
magenta: 'upstream/HEAD', | ||
blue: (branch_exist?('origin/HEAD') ? 'origin/HEAD' : main_branch), | ||
cyan: ('@{u}' unless current_branch_main?) | ||
} | ||
|
||
$forks.select! { |k, v| branch_exist?(v) } | ||
|
||
gets | ||
exit 0 unless $_ | ||
sha, rest = $_.split("\e", 2) | ||
first = `git rev-parse --short #{sha}^ 2>/dev/null`.chomp | ||
first = first.empty? ? '' : "#{first}.." | ||
$forks.transform_values! do |v| | ||
`git log --format=%h #{first}#{v}`.chomp.split("\n").to_h { |k| [k, nil] } | ||
end | ||
def render(sha, rest) | ||
color = if $forks[:magenta]&.key?(sha) | ||
"\e[35m" | ||
elsif $forks[:blue]&.key?(sha) | ||
"\e[34m" | ||
elsif $forks[:cyan]&.key?(sha) | ||
"\e[36m" | ||
else | ||
"\e[32m" | ||
end | ||
"#{color}#{sha}\e#{rest.chomp}\e[0m" | ||
end | ||
print "\x1b[?7l" | ||
print render(sha, rest) | ||
while gets | ||
puts | ||
print render(*$_.split("\e", 2)) | ||
end | ||
puts "\x1b[?7h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
# The most canonical branch | ||
|
||
git_main_remote_branch || git_main_branch | ||
git_main_remote_branch || git_main_branch_no_remote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
branch_if_exist() | ||
{ | ||
git branch --list --format="%(refname:short)" "$1" | ||
} | ||
branch_fallback() | ||
{ | ||
branch_if_exist "$(git config init.defaultBranch)" || \ | ||
branch_if_exist main || \ | ||
branch_if_exist master || \ | ||
branch_if_exist trunk || \ | ||
branch_if_exist primary || \ | ||
git_branch_name | ||
} | ||
|
||
remote_branch=$(git_main_remote_branch) | ||
branch=${remote_branch#*/} | ||
|
||
echo ${branch:-$(branch_fallback)} | ||
# the local version of the most canonical branch | ||
remote_branch="$(git_main_remote_branch)" | ||
branch="${remote_branch#*/}" | ||
echo "${branch:-"$(git_main_branch_no_remote)"}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
# origin/HEAD only works if we have an origin, otherwise, guess. | ||
git_branch_if_exist "$(git config init.defaultBranch)" || \ | ||
git_branch_if_exist main || \ | ||
git_branch_if_exist master || \ | ||
git_branch_if_exist trunk || \ | ||
git_branch_if_exist primary || \ | ||
git_branch_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
remotes=( $(git remote) ); | ||
if (( ${#remotes[@]} == 0 )); then | ||
# remotes can't contain spaces: | ||
unsorted_remotes=( $(git remote) ); | ||
|
||
if (( ${#unsorted_remotes[@]} == 0 )); then | ||
false | ||
else | ||
for remote in ${remotes[@]}; do | ||
git rev-parse --verify --quiet $remote/HEAD >/dev/null 2>&1 || git remote set-head "$remote" -a >/dev/null 2>&1 | ||
git rev-parse --verify --symbolic-full-name --abbrev-ref=strict remotes/"$remote"/HEAD 2>/dev/null && break | ||
false | ||
# sort origin and upstream first | ||
origin=() | ||
upstream=() | ||
rest_remotes=() | ||
|
||
for remote in "${unsorted_remotes[@]}"; do | ||
case "$remote" in | ||
origin) origin+=(origin) ;; | ||
upstream) upstream+=(upstream) ;; | ||
*) rest_remotes+=($remote) ;; | ||
esac | ||
done | ||
|
||
found='' | ||
|
||
for remote in "${origin[@]}" "${upstream[@]}" "${rest_remotes[@]}"; do | ||
git_branch_if_exist "$remote"/HEAD >/dev/null 2>&1 || \ | ||
git remote set-head "$remote" -a >/dev/null 2>&1 || \ | ||
( git fetch "$remote" >/dev/null 2>&1 && \ git remote set-head "$remote" -a >/dev/null 2>&1 ) | ||
[[ -z "$found" ]] && found=$(git_branch_name "$remote"/HEAD 2>/dev/null) | ||
done | ||
[[ ! -z "$found" ]] && echo $found || false | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
git diff --name-only HEAD --diff-filter=ACM -- "${@/#/*}" | ||
git diff --name-only HEAD --diff-filter=ACM -- "${@/#/*}" |
Oops, something went wrong.