-
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.
Merge thoughtbot repo into this and add ~/.config/
- Loading branch information
1 parent
d397ff2
commit e0a30eb
Showing
76 changed files
with
1,539 additions
and
184 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
LICENSE | ||
|
||
The MIT License | ||
|
||
Copyright (c) 2009-2016 thoughtbot, inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
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 @@ | ||
/vendor |
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 @@ | ||
legacy_version_file = yes |
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,15 @@ | ||
#!/bin/sh | ||
|
||
# Search your bundle for the provided pattern | ||
# Requires bundler 1.8+ for execution as a bundler subcommand. | ||
# Examples: | ||
# bundle search Kernel.warn | ||
# bundle search current_user clearance | ||
# bundle search "Change your password" clearance | ||
# | ||
# Arguments: | ||
# 1. What to search for | ||
# 2. Which gem names to search (defaults to all gems) | ||
|
||
pattern="$1"; shift | ||
ag "$pattern" $(bundle show --paths "$@") |
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,15 @@ | ||
#!/bin/sh | ||
|
||
# Kills the process running on the provided port | ||
# | ||
# clear-port 3000 | ||
|
||
if [ -n "$1" ]; then | ||
port_num="$(lsof -ti4TCP:"$1")" | ||
if [ $? -eq 0 ]; then | ||
kill "$port_num" | ||
fi | ||
else | ||
echo >&2 Usage: clear-port port-number | ||
exit 1 | ||
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
git commit --amend -v --date="$(date +%Y-%m-%dT%H:%M:%S)" |
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,24 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
pull_request_number=$1 | ||
local_branch_name=$2 | ||
|
||
if [ -z "$pull_request_number" -o -z "$local_branch_name" ]; then | ||
echo "usage: git co-upstream-pr <pull_request_number> <local_branch_name>" | ||
exit 1 | ||
fi | ||
|
||
if git remote -v | grep -q upstream; then | ||
git fetch upstream "pull/$pull_request_number/head:$local_branch_name" | ||
git checkout "$local_branch_name" | ||
else | ||
cat <<HELP | ||
You don't have an upstream remote set. | ||
Use: | ||
git remote add upstream {upstream_remote_url} | ||
to set the reference and then try again. | ||
HELP | ||
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
git push origin "HEAD:refs/heads/$1" | ||
git fetch origin | ||
git branch --track "$1" "origin/$1" | ||
cd . | ||
git checkout "$1" |
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,6 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
[ -f .git/hooks/ctags ] || git init | ||
.git/hooks/ctags |
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,5 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
git rev-parse --abbrev-ref HEAD |
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,6 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
git push origin :refs/heads/"$1" | ||
git branch --delete "$1" |
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,26 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
if git symbolic-ref --short refs/remotes/origin/HEAD >/dev/null; then | ||
main_branch="$(git symbolic-ref --short refs/remotes/origin/HEAD | sed 's@^origin/@@')" "$@" | ||
else | ||
echo "You don't have a primary branch reference set for your origin remote. | ||
Use: | ||
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/{name_of_your_primary_branch} | ||
to set the reference and then try merging again." | ||
|
||
exit 1 | ||
fi | ||
|
||
git fetch origin | ||
line_count=$(git diff origin/$main_branch..$main_branch | wc -l) | ||
|
||
if [ $line_count -gt 0 ]; then | ||
printf "failed: $main_branch is not up to date with origin/$main_branch\n" | ||
exit 1 | ||
fi | ||
|
||
git checkout $main_branch | ||
git merge "@{-1}" |
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,8 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
old=$(git current-branch) | ||
git branch -m "$old" "$1" | ||
git push origin --set-upstream "$1" | ||
git push origin --delete "$old" |
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 @@ | ||
#!/bin/sh | ||
|
||
mkdir -p .git/safe |
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,16 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
git fetch origin | ||
|
||
if git symbolic-ref --short refs/remotes/origin/HEAD >/dev/null; then | ||
git fetch origin | ||
git rebase "$(git symbolic-ref --short refs/remotes/origin/HEAD)" "$@" | ||
else | ||
echo "You don't have a primary branch reference set for your origin remote. | ||
Use: | ||
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/{name_of_your_primary_branch} | ||
to set the reference and then try rebasing again." | ||
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
# | ||
# Find and replace by a given list of files. | ||
# | ||
# replace foo bar **/*.rb | ||
|
||
find_this="$1" | ||
shift | ||
replace_with="$1" | ||
shift | ||
|
||
if command -v rg &>/dev/null ; then | ||
items=$(rg -l --color never "$find_this" "$@") | ||
else | ||
items=$(ag -l --nocolor "$find_this" "$@") | ||
fi | ||
|
||
temp="${TMPDIR:-/tmp}/replace_temp_file.$$" | ||
IFS=$'\n' | ||
for item in $items; do | ||
sed "s/$find_this/$replace_with/g" "$item" > "$temp" && mv "$temp" "$item" | ||
done |
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,31 @@ | ||
#!/bin/sh | ||
# | ||
# Attach or create tmux session named the same as current directory. | ||
|
||
path_name="$(basename "$PWD" | tr . -)" | ||
session_name=${1-$path_name} | ||
|
||
not_in_tmux() { | ||
[ -z "$TMUX" ] | ||
} | ||
|
||
session_exists() { | ||
tmux has-session -t "=$session_name" | ||
} | ||
|
||
create_detached_session() { | ||
(TMUX='' tmux new-session -Ad -s "$session_name") | ||
} | ||
|
||
create_if_needed_and_attach() { | ||
if not_in_tmux; then | ||
tmux new-session -As "$session_name" | ||
else | ||
if ! session_exists; then | ||
create_detached_session | ||
fi | ||
tmux switch-client -t "$session_name" | ||
fi | ||
} | ||
|
||
create_if_needed_and_attach |
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,16 @@ | ||
#!/bin/sh | ||
|
||
# List process running on provided port | ||
# | ||
# whats-in-port 3000 | ||
# | ||
# output: | ||
# COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | ||
# ruby 25583 root 11u IPv4 0xee20607697a79bf7 0t0 TCP *:irdmi (LISTEN) | ||
|
||
if [ -n "$1" ]; then | ||
lsof -ni4TCP:"$1" | ||
else | ||
echo >&2 Usage: whats-in-port port-number | ||
exit 1 | ||
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import = ['/home/borges/.config/alacritty/dracula/dracula.toml'] | ||
|
||
[font] | ||
size = 13.0 | ||
|
||
[font.normal] | ||
family = "MesloLGS NF" | ||
|
||
[[keyboard.bindings]] | ||
action = "ToggleFullscreen" | ||
key = "Return" | ||
mods = "Alt" | ||
|
||
[[keyboard.bindings]] | ||
chars = "\u001B[94;5u" | ||
key = "Key6" | ||
mods = "Control" | ||
|
||
[[keyboard.bindings]] | ||
chars = "\u001B[13;2u" | ||
key = "Return" | ||
mods = "Shift" | ||
|
||
[[keyboard.bindings]] | ||
chars = "\u001B[13;5u" | ||
key = "Return" | ||
mods = "Control" | ||
|
||
# [shell] | ||
# args = ["--cd ~/Projects/hs"] | ||
# program = 'C:\Windows\System32\wsl.exe' | ||
|
||
[window.dimensions] | ||
columns = 205 | ||
lines = 55 | ||
|
||
[window.position] | ||
x = 200 | ||
y = 50 | ||
|
||
# [window] | ||
# decorations = 'none' | ||
# padding.x = 0 | ||
# padding.y = 0 |
Oops, something went wrong.