Skip to content

Commit 962f7fc

Browse files
committed
moooo
2 parents 0707d80 + fcba83a commit 962f7fc

12 files changed

Lines changed: 363 additions & 27 deletions

File tree

.bash_profile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@ if [ -e "${HOME}/.bashrc" ] ; then
33
source "${HOME}/.bashrc"
44
fi
55

6-
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
7-
8-
# node modules path
9-
export PATH=./node_modules/.bin:$PATH
10-
11-
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
12-
136
# http://grnds.askbot.com/question/345/how-do-i-set-up-my-ipsec-with-the-vpn-psk-that-is-emailed-to-me-how-do-i-connect-to-uat/?answer=346#post-id-346
147
export IPSEC_SECRETS_FILE=/etc/ipsec.secrets
158
export KEY_SUFFIX=grandrounds.com
169

10+
#source /usr/local/share/chruby/chruby.sh
11+
#source /usr/local/share/chruby/auto.sh
12+
#chruby ruby-2.1.5
13+
1714
# These were installed by the bin/setup script of the jarvis repo, however
1815
# they seem to be not needed, and cause errors like:
1916
#
@@ -26,5 +23,3 @@ export KEY_SUFFIX=grandrounds.com
2623

2724
#test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
2825

29-
[[ -s "/Users/andrewray/.gvm/scripts/gvm" ]] && source "/Users/andrewray/.gvm/scripts/gvm"
30-

.bashrc

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pathrm() {
2626
PATH="$(echo $PATH | sed -e "s;\(^\|:\)${1%/}\(:\|\$\);\1\2;g" -e 's;^:\|:$;;g' -e 's;::;:;g')"
2727
}
2828

29-
3029
# Configuration for the command line tool "hh" (history searcher to replace ctrl-r, brew install hh)
3130
export HH_CONFIG=hicolor,rawhistory,favorites # get more colors
3231
shopt -s histappend # append new history items to .bash_history
@@ -267,6 +266,8 @@ if [ -f ~/.git-completion.bash ]; then
267266
fi
268267

269268
alias here='open .'
269+
270+
# ln -s /Applications/MacVim.app/Contents/bin/mvim /usr/local/bin/mvim
270271
alias vim='mvim'
271272

272273
# Hack to show the version of an installed perl module.
@@ -897,23 +898,53 @@ function gr_banana() {
897898

898899
PS1="\n\[$COLOR_YELLOW\]\u\[\$(error_test)\]@\[$COLOR_GREEN\]\w\$(${dvcs_function})\[$COLOR_RESET\] \$ "
899900

901+
# make sound good
902+
function ding() {
903+
afplay /System/Library/Sounds/Glass.aiff
904+
}
905+
900906
# Grand rounds stuff
901907
export GR_HOME=${HOME}/dev
902908
export GR_USERNAME=andrew.ray
903909

910+
function gr_locked_gpg() {
911+
if pgrep -f "gpg --use-agent --no-tty --quiet -o" > /dev/null
912+
then
913+
echo 1
914+
else
915+
echo 0
916+
fi
917+
}
918+
919+
sleep_rand() {
920+
rand=${RANDOM:0:1} # 0 - 9 https://stackoverflow.com/questions/1194882/how-to-generate-random-number-in-bash
921+
sleep "0.${rand}"
922+
}
923+
904924
if [ -d "$GR_HOME" ]; then
905925

906-
if [ -n "$LOGIN_WAIT" ]; then
907-
echo "waiting ${LOGIN_WAIT}"
926+
sleep_rand
927+
locked=$(gr_locked_gpg)
928+
if [ "$locked" == "1" ]; then
929+
echo 'Someone else is using the gpg agent, waitng...'
930+
bail=0
931+
932+
while [ "$locked" == "1" ] && [ $bail != 100 ]
933+
do
934+
sleep_rand
935+
locked=$(gr_locked_gpg)
936+
let bail+=1
937+
done
908938
fi
939+
909940
for file in ${GR_HOME}/engineering/bash/*.sh; do
910-
source $file;
941+
source "$file"
911942
done
912943

913944
pathadd "${GR_HOME}/engineering/bin"
914945

915946
# default to aws env
916-
aws-environment development
947+
aws-environment || aws-environment development
917948

918949
# allow for pivotal prme command
919950
tracker-environment
@@ -966,7 +997,8 @@ if [[ $(command -v pyenv) ]]; then
966997
fi
967998
fi
968999

969-
export IPSEC_SECRETS_FILE=/etc/ipsec.secrets
1000+
# legacy line? testing removing for new laptop setup and not linux
1001+
# export IPSEC_SECRETS_FILE=/etc/ipsec.secrets
9701002
export KEY_SUFFIX=grandrounds.com
9711003

9721004
# GR
@@ -1011,6 +1043,8 @@ fi
10111043

10121044
[[ -s /Users/andrewray/.rsvm/rsvm.sh ]] && . /Users/andrewray/.rsvm/rsvm.sh # This loads RSVM
10131045

1046+
alias cat='bat --theme=TwoDark'
1047+
10141048
# aliased to "sw"
10151049
# Easily checkout git branches, listed from a dialog menu
10161050
# dialog settings may be set in ~/.dialogrc
@@ -1101,6 +1135,15 @@ if [ -d "$TRACKER_FLOW_PATH" ]; then
11011135
. "$TRACKER_FLOW_PATH/tracker_completion.bash"
11021136
fi
11031137

1104-
function ding() {
1105-
afplay /System/Library/Sounds/Glass.aiff
1106-
}
1138+
# Chruby
1139+
CHRUBY_PATH="/usr/local/share/chruby/"
1140+
if [ -d "$CHRUBY_PATh" ]; then
1141+
source "${CHRUBY_PATH}chruby.sh"
1142+
source "${CHRUBY_PATH}auto.sh"
1143+
1144+
# set default chruby https://github.com/postmodern/chruby#default-ruby
1145+
chruby 2.5.1
1146+
fi
1147+
1148+
# loads nvm bash_completion
1149+
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vim/.netrwhist
2+
.vim/bundle/anzu/doc/tags-ja
3+
.vim/bundle/clam.vim/doc/tags
4+

.my.cnf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[mysql]
22
auto-rehash
3+
4+
[mysqldump]
5+
column-statistics=0

.pryrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ rescue LoadError
1515
puts "Warning: factory_bot_rails gem not found"
1616
end
1717

18+
# Gives domestic_phone_number for creating factories that use phone numbers
19+
begin
20+
require './spec/support/faker_phones.rb'
21+
puts "#{'require'.light_red} #{"'./spec/support/faker_phones.rb'".cyan}"
22+
rescue LoadError
23+
puts "Warning: ./spec/support/faker_phones.rb not found"
24+
end
25+
26+
1827
# rails 5.1 break?
1928
#begin
2029
#Rails.application.routes.url_helpers
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Vim Markdown runtime files
2+
3+
This is the development version of Vim's included syntax highlighting and
4+
filetype plugins for Markdown. Generally you don't need to install these if
5+
you are running a recent version of Vim.
6+
7+
One difference between this repository and the upstream files in Vim is that
8+
the former forces `*.md` as Markdown, while the latter detects it as Modula-2,
9+
with an exception for `README.md`. If you'd like to force Markdown without
10+
installing from this repository, add the following to your vimrc:
11+
12+
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
13+
14+
If you want to enable fenced code block syntax highlighting in your markdown
15+
documents you can enable it in your `.vimrc` like so:
16+
17+
let g:markdown_fenced_languages = ['html', 'python', 'bash=sh']
18+
19+
To disable markdown syntax concealing add the following to your vimrc:
20+
21+
let g:markdown_syntax_conceal = 0
22+
23+
Syntax highlight is synchronized in 50 lines. It may cause collapsed
24+
highlighting at large fenced code block.
25+
In the case, please set larger value in your vimrc:
26+
27+
let g:markdown_minlines = 100
28+
29+
Note that setting too large value may cause bad performance on highlighting.
30+
31+
## License
32+
33+
Copyright © Tim Pope. Distributed under the same terms as Vim itself.
34+
See `:help license`.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
autocmd BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mkd,*.mkdn,*.mdwn
2+
\ if &ft =~# '^\%(conf\|modula2\)$' |
3+
\ set ft=markdown |
4+
\ else |
5+
\ setf markdown |
6+
\ endif
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
" Vim filetype plugin
2+
" Language: Markdown
3+
" Maintainer: Tim Pope <[email protected]>
4+
" Last Change: 2013 May 30
5+
6+
if exists("b:did_ftplugin")
7+
finish
8+
endif
9+
10+
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
11+
12+
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=<!--%s-->
13+
setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
14+
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:
15+
16+
if exists('b:undo_ftplugin')
17+
let b:undo_ftplugin .= "|setl cms< com< fo< flp<"
18+
else
19+
let b:undo_ftplugin = "setl cms< com< fo< flp<"
20+
endif
21+
22+
function! MarkdownFold()
23+
let line = getline(v:lnum)
24+
25+
" Regular headers
26+
let depth = match(line, '\(^#\+\)\@<=\( .*$\)\@=')
27+
if depth > 0
28+
return ">" . depth
29+
endif
30+
31+
" Setext style headings
32+
let nextline = getline(v:lnum + 1)
33+
if (line =~ '^.\+$') && (nextline =~ '^=\+$')
34+
return ">1"
35+
endif
36+
37+
if (line =~ '^.\+$') && (nextline =~ '^-\+$')
38+
return ">2"
39+
endif
40+
41+
return "="
42+
endfunction
43+
44+
function! MarkdownFoldText()
45+
let hash_indent = s:HashIndent(v:foldstart)
46+
let title = substitute(getline(v:foldstart), '^#\+\s*', '', '')
47+
let foldsize = (v:foldend - v:foldstart + 1)
48+
let linecount = '['.foldsize.' lines]'
49+
return hash_indent.' '.title.' '.linecount
50+
endfunction
51+
52+
function! s:HashIndent(lnum)
53+
let hash_header = matchstr(getline(a:lnum), '^#\{1,6}')
54+
if len(hash_header) > 0
55+
" hashtag header
56+
return hash_header
57+
else
58+
" == or -- header
59+
let nextline = getline(a:lnum + 1)
60+
if nextline =~ '^=\+\s*$'
61+
return repeat('#', 1)
62+
elseif nextline =~ '^-\+\s*$'
63+
return repeat('#', 2)
64+
endif
65+
endif
66+
endfunction
67+
68+
if has("folding") && exists("g:markdown_folding")
69+
setlocal foldexpr=MarkdownFold()
70+
setlocal foldmethod=expr
71+
setlocal foldtext=MarkdownFoldText()
72+
let b:undo_ftplugin .= " foldexpr< foldmethod< foldtext<"
73+
endif
74+
75+
" vim:set sw=2:

0 commit comments

Comments
 (0)