Skip to content

Commit 1ab2de4

Browse files
committed
Merge branch 'master' of github.com:AndrewRayCode/configs
2 parents 8d229cd + f18f1d1 commit 1ab2de4

6 files changed

Lines changed: 55 additions & 180 deletions

File tree

.bashrc

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,6 @@ function dvcs_commit_all {
688688
fi
689689
}
690690

691-
# This code was auto generated by with these options:
692-
# - file:///Users/aray/bash-prompt-builder/index.html#git=true&git-prefix=false&git-ahead=true&git-modified=true&git-conflicted=true&git-revno=false&git-bisect=true&hg=true&hg-prefix=false&hg-modified=true&hg-conflicted=true&hg-revno=false&hg-bisect=true&hg-patches=true&svn=true&svn-modified=true&svn-revno=true&comments=false&modified-char=%E2%9C%8E&conflict-char=%E2%98%A2&max-conflicted-files=2&no-branch-text=no%20branch!&bisecting-text=%CF%9F
693-
#
694691
# Requirements (other than git, svn and hg):
695692
# hg-prompt: https://bitbucket.org/sjl/hg-prompt/src
696693
# svnversion (you probably have it if you have svn)
@@ -903,7 +900,6 @@ dvcs_function="
903900
fi
904901
905902
echo -e \$prompt"
906-
# End code auto generated by http://andrewray.me/bash-prompt-builder/index.html
907903

908904
function error_test() {
909905
if [[ $? = "0" ]]; then
@@ -930,7 +926,7 @@ function ding() {
930926
}
931927

932928
# Python development, requires pyenv from homebrew
933-
# Needs to go before GR stuff to
929+
# Needs to go before GR stuff
934930
if [[ $(command -v pyenv) ]]; then
935931
export PYENV_ROOT="$HOME/.pyenv"
936932

@@ -955,27 +951,8 @@ function gr_locked_gpg() {
955951
fi
956952
}
957953

958-
sleep_rand() {
959-
rand=${RANDOM:0:1} # 0 - 9 https://stackoverflow.com/questions/1194882/how-to-generate-random-number-in-bash
960-
sleep "0.${rand}"
961-
}
962954

963955
if [ -d "$GR_HOME" ]; then
964-
965-
sleep_rand
966-
locked=$(gr_locked_gpg)
967-
if [ "$locked" == "1" ]; then
968-
echo 'Someone else is using the gpg agent, waitng...'
969-
bail=0
970-
971-
while [ "$locked" == "1" ] && [ $bail != 100 ]
972-
do
973-
sleep_rand
974-
locked=$(gr_locked_gpg)
975-
let bail+=1
976-
done
977-
fi
978-
979956
for file in ${GR_HOME}/engineering/bash/*.sh; do
980957
source "$file"
981958
done
@@ -1058,7 +1035,7 @@ function releaseCommits() {
10581035

10591036
function jgrep() {
10601037
#bundle exec rake routes > ~/dev/rake-routes
1061-
cat ~/dev/rake-routes | grep "$1"
1038+
cat ~/dev/rake-routes | grep -i "$1"
10621039
}
10631040

10641041
if type "bat" > /dev/null 2>&1; then
@@ -1158,6 +1135,11 @@ function docker_tag_exists() {
11581135
fi
11591136
}
11601137

1138+
LEGACY_TERRAFORM_PATH="/usr/local/opt/[email protected]/bin"
1139+
if [ -d "$LEGACY_TERRAFORM_PATH" ]; then
1140+
pathadd "$LEGACY_TERRAFORM_PATH"
1141+
fi
1142+
11611143
TRACKER_FLOW_PATH="$GR_HOME/tracker-flow"
11621144
if [ -d "$TRACKER_FLOW_PATH" ]; then
11631145
pathadd "$TRACKER_FLOW_PATH"

.jshintrc

Lines changed: 0 additions & 125 deletions
This file was deleted.

.pryrc

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# -----------------------------------------------------------------------------
1212
# Rails app spits out lots of startup garbage, separate this
1313
def notice_me(msg)
14-
puts '*' * 100
14+
puts "☠ #{'❌' * 30} ☠"
1515
puts "❌ #{msg}"
1616
puts
1717
end
@@ -29,6 +29,16 @@ rescue Exception => ex # Did you know LoadError inherits from Exception, not Sta
2929
notice_me "Warning: colorize gem not found, make sure you:\n - Installed colorize locally (gem install colorize)\n - This path exists: #{colorize_init_file}\n#{ex.message}"
3030
end
3131

32+
# -----------------------------------------------------------------------------
33+
# Load the route helpers in the terminal so you can generate page URLs
34+
# admin_stark_user_path / admin_stark_user_url
35+
begin
36+
include Rails.application.routes.url_helpers
37+
puts "✅ #{'include'.light_yellow} #{'Rails.application.routes.url_helpers'.cyan}"
38+
rescue LoadError
39+
puts "Warning: factory_bot_rails gem not found"
40+
end
41+
3242
# -----------------------------------------------------------------------------
3343
# Enables FactoryBot in a pry session
3444
begin
@@ -47,31 +57,33 @@ rescue StandardError
4757
notice_me "Warning: ./spec/support/anna_spec_helper not found"
4858
end
4959

50-
# -----------------------------------------------------------------------------
51-
# Enables a lot more factories which explicilty need the domestic_phone_number
52-
# gem for creating factories that use phone numbers
53-
begin
54-
require './spec/support/faker_phones.rb'
55-
puts "✅ #{'require'.light_red} #{"'./spec/support/faker_phones.rb'".cyan}"
56-
rescue StandardError
57-
notice_me "Warning: ./spec/support/faker_phones.rb not found"
58-
end
59-
60-
61-
# -----------------------------------------------------------------------------
62-
# Load the route helpers in the terminal so you can generate page URLs
63-
# admin_stark_user_path / admin_stark_user_url
64-
begin
65-
include Rails.application.routes.url_helpers
66-
puts "✅ #{'include'.light_yellow} #{'Rails.application.routes.url_helpers'.cyan}"
67-
rescue LoadError
68-
puts "Warning: factory_bot_rails gem not found"
69-
end
70-
7160
# =============================================================================
7261
# Helper functions (not meant to be run directly)
7362
# =============================================================================
7463

64+
def globRequire(path)
65+
successes = []
66+
failures = []
67+
Dir.glob(path).each do |file|
68+
begin
69+
require file
70+
successes << file
71+
rescue Exception => e
72+
failures << "Warning: Could not require #{file}? #{e.message}"
73+
end
74+
end
75+
if successes.count > 0
76+
puts "✅ #{'require {'.light_red}#{successes.join(', ').cyan}#{'}'.light_red}"
77+
end
78+
notice_me failures if failures.present?
79+
end
80+
81+
# -----------------------------------------------------------------------------
82+
# Enables a lot more factories which need our custom Faker plugins. I'm too
83+
# lazy to make the method a separate file and require it so that I can call
84+
# this method above the definitino
85+
globRequire('./spec/support/faker_*.rb')
86+
7587
# -----------------------------------------------------------------------------
7688
# Print a full stack trace with colorized output for easier
7789
def colorized_stack_trace( stack, base_dir )

.vimrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ set guioptions=mer
145145
" Use spaces always
146146
set expandtab
147147

148-
" Copy indent from current line when starting a new line
148+
" Copy indent from current line when starting a new line
149149
set autoindent
150150

151151
" Break at specific characters when wrapping long lines (:set breakat?)
@@ -373,6 +373,9 @@ nnoremap <Leader>ff ?^func\\|^[a-zA-Z].*func<CR>,/
373373

374374
nnoremap <C-L> <C-w>l
375375
376+
" Todo fix b
377+
nnoremap <Leader>cp dd?✅<cr>p0ls✅<esc><c-o>
378+
376379
" experimental - enter to go into command mode (otherwise useless shortcut).
377380
" See clickable_maps for preventing vim clickable from messing this up. Also
378381
" see :h <cr> which is duplicated by BOTH ctrl-m AND + lol

code/keybindings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
{ "key": "cmd-k l", "command": "latex-workshop.tab", "when": "editorTextFocus" },
99
{ "key": "cmd-alt-m", "command": "workbench.action.terminal.focus" },
1010
{ "key": "cmd-alt-m", "command": "workbench.action.terminal.focus" },
11+
{ "key": "cmd-shift-b", "command": "editor.action.revealDefinition", "when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor" },
1112

1213
// terrible defaults for "rails run specs"
1314
{ "key": "shift+cmd+t", "command": "workbench.action.reopenClosedEditor" },

code/settings.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"eslint.enable": true,
44
"javascript.validate.enable": false,
55
"editor.rulers": [80],
6-
"window.zoomLevel": 1,
6+
"window.zoomLevel": 2,
77
"files.exclude": {
88
"**/.DS_Store": true,
99
"**/.git": true,
@@ -17,7 +17,6 @@
1717
"workbench.editor.enablePreview": true,
1818
"workbench.editor.enablePreviewFromQuickOpen": false,
1919
"workbench.colorTheme": "rainbow",
20-
2120
"editor.renderWhitespace": "none",
2221
"gitlens.advanced.messages": {
2322
"suppressShowKeyBindingsNotice": true
@@ -26,8 +25,12 @@
2625
"javascript.updateImportsOnFileMove.enabled": "always",
2726
"typescript.updateImportsOnFileMove.enabled": "always",
2827
"breadcrumbs.enabled": true,
29-
"editor.formatOnSave": true,
28+
"[javascript]": {
29+
"editor.formatOnSave": true,
30+
"editor.defaultFormatter": "esbenp.prettier-vscode"
31+
},
3032
"editor.tabSize": 2,
33+
"editor.tabCompletion": "on",
3134
"editor.snippetSuggestions": "top",
3235
"terminal.integrated.rendererType": "dom",
3336
"editor.tokenColorCustomizations": {
@@ -76,7 +79,6 @@
7679
"gitlens.hovers.currentLine.over": "line",
7780
"gitlens.codeLens.enabled": false,
7881
"errorLens.gutterIconsEnabled": true,
79-
"[javascript]": {
80-
"editor.defaultFormatter": "esbenp.prettier-vscode"
81-
}
82-
}
82+
"files.autoSave": "off",
83+
"breadcrumbs.symbolPath": "off"
84+
}

0 commit comments

Comments
 (0)