Skip to content

Commit 0ef5441

Browse files
committed
moo
1 parent 14c3c4f commit 0ef5441

5 files changed

Lines changed: 54 additions & 4 deletions

File tree

.bashrc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,3 +1201,37 @@ function apexpmd() {
12011201
}
12021202
export -f apexpmd
12031203

1204+
# 1 salesforci boi
1205+
1206+
# Find the value of any custom labels on a system matching a search pattern
1207+
lbl() {
1208+
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
1209+
echo "Usage: lbl [ORG_ID] [LABEL_REGEX]"
1210+
return 1
1211+
fi
1212+
local result
1213+
result=$(sfdx force:mdapi:listmetadata -m CustomLabel -u "${1}" --json)
1214+
# shellcheck disable=SC2181
1215+
if [ $? -ne 0 ];
1216+
then
1217+
echo "Error!"
1218+
echo "${result}"
1219+
else
1220+
echo "All labels on ${1} matching '${2}' (case insensitive):"
1221+
echo "${result}" | jq -r '.result[] | select(.fullName|test("'"${2}"'"; "i")) | .fullName' | while read -r line ; do
1222+
stmt "${1}" "'${line}: ' + Label.${line}"
1223+
done
1224+
fi
1225+
}
1226+
1227+
# Execute an apex statement against an environment
1228+
stmt() {
1229+
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
1230+
echo "Usage: stmt [ORG_ID] [STATEMENT_TO_EVALUATE]"
1231+
return 1
1232+
fi
1233+
1234+
sfdx force:apex:execute -u "${1}" -f /dev/stdin<<<'System.debug('"${2}"');' | # Execute the statement inside a system.debug(). execute expects a file, so use <<< trick to make it seem like a file
1235+
grep USER_DEBUG | # search for the debug line
1236+
sed 's/.*\|//' # find everything after the last pipe, which will be the debugged output
1237+
}

.vimrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ function! ToggleQuickFix()
461461
endif
462462
endfunction
463463

464-
nnoremap <Leader>cx :call ToggleQuickFix()<CR>
464+
nnoremap <Leader>cq :call ToggleQuickFix()<CR>
465465
466466

467467
"------------------------------------------------------------------------------
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"Debug Emojis": {
1111
"scope": "apex,apex-anon",
1212
"prefix": "dd",
13-
"body": ["System.debug('${1|🔥,❌,🚽,🌿,💙|}$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1');"],
13+
"body": ["System.debug('${1|💙,🌿,💎,🚨,💛,💚,🔥,❌,🚽|}$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1$1');"],
1414
"description": "Make console output noticable"
1515
},
1616
"Debug": {

code/snippets/ecmascript.code-snippets

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@
1515
// ],
1616
// "description": "Log output to console"
1717
// }
18+
"Console Log Parse": {
19+
"scope": "javascript,typescript",
20+
"prefix": "cj",
21+
"body": [
22+
"console.log(JSON.parse(JSON.stringify($1)))",
23+
],
24+
"description": "Console log garbo salesforce proxy"
25+
},
26+
"Console Log Parse": {
27+
"scope": "javascript,typescript",
28+
"prefix": "cjj",
29+
"body": [
30+
"console.log('$1', JSON.parse(JSON.stringify($1)))",
31+
],
32+
"description": "Console log garbo salesforce proxy"
33+
},
1834
"Console Log": {
1935
"scope": "javascript,typescript",
2036
"prefix": "c",

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ if [[ -d "$vsCodeDir" ]]; then
9797
# putting these here for easy working with later
9898
#ln -fs /Users/andrewray/configs/code/settings.json /Users/andrewray/Library/Application\ Support/Code/User/
9999
#ln -fs /Users/andrewray/configs/code/snippets/javascript.json "/Users/andrewray/Library/Application Support/Code/User/snippets/javascript.json"
100-
#ln -fs /Users/andrewray/configs/code/snippets/ecmascript.code-snippets.json "/Users/andrewray/Library/Application Support/Code/User/snippets/ecmascript.code-snippets.json"
101-
#ln -fs /Users/andrewray/configs/code/snippets/apex.code-snippets.json "/Users/andrewray/Library/Application Support/Code/User/snippets/apex.code-snippets.json"
100+
# ln -fs "${HOME}/configs/code/snippets/ecmascript.code-snippets" "${HOME}/Library/Application Support/Code/User/snippets/ecmascript.code-snippets"
101+
# ln -fs "${HOME}/configs/code/snippets/apex.code-snippets" "${HOME}/Library/Application Support/Code/User/snippets/apex.code-snippets"
102102

103103
let "symlinks+=1"
104104
fi

0 commit comments

Comments
 (0)