Skip to content

Commit 0b117b8

Browse files
committed
dorf
1 parent 1436427 commit 0b117b8

9 files changed

Lines changed: 333 additions & 19 deletions

File tree

.bash_profile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ 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

.bashrc

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

29+
# RVM
30+
pathadd "$HOME/.rvm/bin" # Add RVM to PATH for scripting
31+
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
32+
33+
# node modules path
34+
pathadd "./node_modules/.bin"
2935

3036
# Configuration for the command line tool "hh" (history searcher to replace ctrl-r, brew install hh)
3137
export HH_CONFIG=hicolor,rawhistory,favorites # get more colors
@@ -901,13 +907,44 @@ PS1="\n\[$COLOR_YELLOW\]\u\[\$(error_test)\]@\[$COLOR_GREEN\]\w\$(${dvcs_functio
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+
function fixrvm() {
920+
source ~/.rvm/scripts/rvm
921+
rvm reload
922+
rvm list
923+
}
924+
925+
sleep_rand() {
926+
rand=${RANDOM:0:1} # 0 - 9 https://stackoverflow.com/questions/1194882/how-to-generate-random-number-in-bash
927+
sleep "0.${rand}"
928+
}
929+
904930
if [ -d "$GR_HOME" ]; then
905931

906-
if [ -n "$LOGIN_WAIT" ]; then
907-
echo "waiting ${LOGIN_WAIT}"
932+
sleep_rand
933+
locked=$(gr_locked_gpg)
934+
if [ "$locked" == "1" ]; then
935+
echo 'Someone else is using the gpg agent, waitng...'
936+
bail=0
937+
938+
while [ "$locked" == "1" ] && [ $bail != 100 ]
939+
do
940+
sleep_rand
941+
locked=$(gr_locked_gpg)
942+
let bail+=1
943+
done
908944
fi
945+
909946
for file in ${GR_HOME}/engineering/bash/*.sh; do
910-
source $file;
947+
source "$file"
911948
done
912949

913950
pathadd "${GR_HOME}/engineering/bin"

.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+
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:
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
" Vim syntax file
2+
" Language: Markdown
3+
" Maintainer: Tim Pope <[email protected]>
4+
" Filenames: *.markdown
5+
" Last Change: 2013 May 30
6+
7+
if exists("b:current_syntax")
8+
finish
9+
endif
10+
11+
if !exists('main_syntax')
12+
let main_syntax = 'markdown'
13+
endif
14+
15+
runtime! syntax/html.vim
16+
unlet! b:current_syntax
17+
18+
if !exists('g:markdown_fenced_languages')
19+
let g:markdown_fenced_languages = []
20+
endif
21+
let s:done_include = {}
22+
for s:type in map(copy(g:markdown_fenced_languages),'matchstr(v:val,"[^=]*$")')
23+
if has_key(s:done_include, matchstr(s:type,'[^.]*'))
24+
continue
25+
endif
26+
if s:type =~ '\.'
27+
let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*')
28+
endif
29+
exe 'syn include @markdownHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim'
30+
unlet! b:current_syntax
31+
let s:done_include[matchstr(s:type,'[^.]*')] = 1
32+
endfor
33+
unlet! s:type
34+
unlet! s:done_include
35+
36+
if !exists('g:markdown_minlines')
37+
let g:markdown_minlines = 50
38+
endif
39+
execute 'syn sync minlines=' . g:markdown_minlines
40+
syn case ignore
41+
42+
syn match markdownValid '[<>]\c[a-z/$!]\@!'
43+
syn match markdownValid '&\%(#\=\w*;\)\@!'
44+
45+
syn match markdownLineStart "^[<@]\@!" nextgroup=@markdownBlock,htmlSpecialChar
46+
47+
syn cluster markdownBlock contains=markdownH1,markdownH2,markdownH3,markdownH4,markdownH5,markdownH6,markdownBlockquote,markdownListMarker,markdownOrderedListMarker,markdownCodeBlock,markdownRule
48+
syn cluster markdownInline contains=markdownLineBreak,markdownLinkText,markdownItalic,markdownBold,markdownCode,markdownEscape,@htmlTop,markdownError
49+
50+
syn match markdownH1 "^.\+\n=\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink
51+
syn match markdownH2 "^.\+\n-\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink
52+
53+
syn match markdownHeadingRule "^[=-]\+$" contained
54+
55+
syn region markdownH1 matchgroup=markdownH1Delimiter start="##\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
56+
syn region markdownH2 matchgroup=markdownH2Delimiter start="###\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
57+
syn region markdownH3 matchgroup=markdownH3Delimiter start="####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
58+
syn region markdownH4 matchgroup=markdownH4Delimiter start="#####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
59+
syn region markdownH5 matchgroup=markdownH5Delimiter start="######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
60+
syn region markdownH6 matchgroup=markdownH6Delimiter start="#######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
61+
62+
syn match markdownBlockquote ">\%(\s\|$\)" contained nextgroup=@markdownBlock
63+
64+
syn region markdownCodeBlock start=" \|\t" end="$" contained
65+
66+
" TODO: real nesting
67+
syn match markdownListMarker "\%(\t\| \{0,4\}\)[-*+]\%(\s\+\S\)\@=" contained
68+
syn match markdownOrderedListMarker "\%(\t\| \{0,4}\)\<\d\+\.\%(\s\+\S\)\@=" contained
69+
70+
syn match markdownRule "\* *\* *\*[ *]*$" contained
71+
syn match markdownRule "- *- *-[ -]*$" contained
72+
73+
syn match markdownLineBreak " \{2,\}$"
74+
75+
syn region markdownIdDeclaration matchgroup=markdownLinkDelimiter start="^ \{0,3\}!\=\[" end="\]:" oneline keepend nextgroup=markdownUrl skipwhite
76+
syn match markdownUrl "\S\+" nextgroup=markdownUrlTitle skipwhite contained
77+
syn region markdownUrl matchgroup=markdownUrlDelimiter start="<" end=">" oneline keepend nextgroup=markdownUrlTitle skipwhite contained
78+
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+"+ keepend contained
79+
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained
80+
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained
81+
82+
syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart
83+
syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained
84+
syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained
85+
syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline
86+
87+
let s:concealends = ''
88+
if has('conceal') && get(g:, 'markdown_syntax_conceal', 1) == 1
89+
let s:concealends = ' concealends'
90+
endif
91+
exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart,@Spell' . s:concealends
92+
exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart,@Spell' . s:concealends
93+
exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic,@Spell' . s:concealends
94+
exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend contains=markdownLineStart,markdownItalic,@Spell' . s:concealends
95+
exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=markdownLineStart,@Spell' . s:concealends
96+
exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend contains=markdownLineStart,@Spell' . s:concealends
97+
98+
syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart
99+
syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart
100+
syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*````*.*$" end="^\s*````*\ze\s*$" keepend
101+
102+
syn match markdownFootnote "\[^[^\]]\+\]"
103+
syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:"
104+
105+
if main_syntax ==# 'markdown'
106+
let s:done_include = {}
107+
for s:type in g:markdown_fenced_languages
108+
if has_key(s:done_include, matchstr(s:type,'[^.]*'))
109+
continue
110+
endif
111+
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*````*\s*'.matchstr(s:type,'[^=]*').'\S\@!.*$" end="^\s*````*\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g')
112+
let s:done_include[matchstr(s:type,'[^.]*')] = 1
113+
endfor
114+
unlet! s:type
115+
unlet! s:done_include
116+
endif
117+
118+
syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]"
119+
syn match markdownError "\w\@<=_\w\@="
120+
121+
hi def link markdownH1 htmlH1
122+
hi def link markdownH2 htmlH2
123+
hi def link markdownH3 htmlH3
124+
hi def link markdownH4 htmlH4
125+
hi def link markdownH5 htmlH5
126+
hi def link markdownH6 htmlH6
127+
hi def link markdownHeadingRule markdownRule
128+
hi def link markdownH1Delimiter markdownHeadingDelimiter
129+
hi def link markdownH2Delimiter markdownHeadingDelimiter
130+
hi def link markdownH3Delimiter markdownHeadingDelimiter
131+
hi def link markdownH4Delimiter markdownHeadingDelimiter
132+
hi def link markdownH5Delimiter markdownHeadingDelimiter
133+
hi def link markdownH6Delimiter markdownHeadingDelimiter
134+
hi def link markdownHeadingDelimiter Delimiter
135+
hi def link markdownOrderedListMarker markdownListMarker
136+
hi def link markdownListMarker htmlTagName
137+
hi def link markdownBlockquote Comment
138+
hi def link markdownRule PreProc
139+
140+
hi def link markdownFootnote Typedef
141+
hi def link markdownFootnoteDefinition Typedef
142+
143+
hi def link markdownLinkText htmlLink
144+
hi def link markdownIdDeclaration Typedef
145+
hi def link markdownId Type
146+
hi def link markdownAutomaticLink markdownUrl
147+
hi def link markdownUrl Float
148+
hi def link markdownUrlTitle String
149+
hi def link markdownIdDelimiter markdownLinkDelimiter
150+
hi def link markdownUrlDelimiter htmlTag
151+
hi def link markdownUrlTitleDelimiter Delimiter
152+
153+
hi def link markdownItalic htmlItalic
154+
hi def link markdownItalicDelimiter markdownItalic
155+
hi def link markdownBold htmlBold
156+
hi def link markdownBoldDelimiter markdownBold
157+
hi def link markdownBoldItalic htmlBoldItalic
158+
hi def link markdownBoldItalicDelimiter markdownBoldItalic
159+
hi def link markdownCodeDelimiter Delimiter
160+
161+
hi def link markdownEscape Special
162+
hi def link markdownError Error
163+
164+
let b:current_syntax = "markdown"
165+
if main_syntax ==# 'markdown'
166+
unlet main_syntax
167+
endif
168+
169+
" vim:set sw=2:

code/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,9 @@
7676
"window.title": "${activeEditorMedium}${separator}${rootName}",
7777
"javascript.updateImportsOnFileMove.enabled": "always",
7878
"typescript.updateImportsOnFileMove.enabled": "always",
79-
"workbench.panel.location": "bottom"
79+
"workbench.panel.location": "bottom",
80+
"editor.tabCompletion": true,
81+
"editor.snippetSuggestions": "top",
82+
"breadcrumbs.enabled": true,
83+
"terminal.integrated.rendererType": "dom"
8084
}

code/snippets/javascript.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
66
// same ids are connected.
77
// Example:
8-
"Print to console": {
9-
"prefix": "log",
10-
"body": [
11-
"console.log( '$1', $1 );",
12-
"$2"
13-
],
14-
"description": "Log output to console"
15-
},
168
"For Loop": {
179
"prefix": "test",
1810
"body": [

0 commit comments

Comments
 (0)