Skip to content

Commit ae05b38

Browse files
committed
The cheese stands alone
1 parent 8674666 commit ae05b38

4 files changed

Lines changed: 56 additions & 25 deletions

File tree

.bashrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,20 @@ function pvault() {
10701070
echo '✅ Run kvault this command to close the tunnel'
10711071
}
10721072

1073+
function i3vault() {
1074+
aws-environment integration3 && \
1075+
echo '🌐 Opening SSH tunnel named "my-vault-tunnel" in background...' && \
1076+
HOST=$(ec2-find -l stone-worker 2> /dev/null | tail -1 | awk '{print $1}') && \
1077+
ssh -M -S my-vault-tunnel -fnNT -L "1234:vault.$(aws-environment).grandrounds.com:443" "$GR_USERNAME@$HOST" && \
1078+
ssh -S my-vault-tunnel -O check "$GR_USERNAME@$HOST" && \
1079+
sleep 5 && \
1080+
echo '🔐 Use this token to log in:' && \
1081+
(aws-environment platform-dev developer && \
1082+
VAULT_ADDR=https://localhost:1234 vault login -tls-skip-verify -token-only -method=aws role=developer) && \
1083+
open 'https://localhost:1234/ui/vault/auth?with=token' && \
1084+
echo '✅ Run kvault this command to close the tunnel'
1085+
}
1086+
10731087
function uvault() {
10741088
uat && \
10751089
echo '🌐 Opening SSH tunnel named "my-vault-tunnel" in background...' && \

.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 )

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" },
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: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"eslint.enable": true,
55
"javascript.validate.enable": false,
66
"editor.rulers": [80],
7-
"window.zoomLevel": 1,
7+
"window.zoomLevel": 2,
88
"files.exclude": {
99
"**/.DS_Store": true,
1010
"**/.git": true,
@@ -31,7 +31,10 @@
3131
"typescript.updateImportsOnFileMove.enabled": "always",
3232
"workbench.panel.location": "bottom",
3333
"breadcrumbs.enabled": true,
34-
"editor.formatOnSave": true,
34+
"[javascript]": {
35+
"editor.formatOnSave": true,
36+
"editor.defaultFormatter": "esbenp.prettier-vscode"
37+
},
3538
"editor.tabSize": 2,
3639
"editor.tabCompletion": true,
3740
"editor.snippetSuggestions": "top",
@@ -47,5 +50,6 @@
4750
},
4851
"workbench.sideBar.location": "left",
4952
// "workbench.settings.editor": "json",
50-
"files.autoSave": "onFocusChange"
53+
"files.autoSave": "off",
54+
"breadcrumbs.symbolPath": "off"
5155
}

0 commit comments

Comments
 (0)