Skip to content

Instantly share code, notes, and snippets.

View marshallvaughn's full-sized avatar
🛠️

Marshall Vaughn marshallvaughn

🛠️
View GitHub Profile
@marshallvaughn
marshallvaughn / sfdx-soql.txt
Created April 26, 2019 03:52
[sfdx SOQL Dash] A Dash snippet
sfdx force:data:soql:query -q "SELECT __fields__ FROM __object__ WHERE __conditions__" -u __username__
@marshallvaughn
marshallvaughn / get-field-names.sh
Created July 16, 2019 19:24
Get an object's field names quickly.
sfdx force:schema:sobject:describe --json -s account | \
jq -r '.result.fields[] | .name'
@marshallvaughn
marshallvaughn / get-to-dos-today.scpt
Last active July 17, 2019 13:44
Gets the to dos from "Today" list, and filters by area "Work"
set dt to current date
set time of dt to 0
log dt
tell application "Things3"
set toDos to to dos in list "Today"
set str to ""
repeat with td in toDos
try
-- This requires setting the shortcut for "Turn Do Not Disturb On/Off" to "shift + cmd + D"
tell application "System Events"
keystroke "D" using {command down, shift down}
end tell
@marshallvaughn
marshallvaughn / cheatsheet.fish
Last active May 17, 2023 06:48
Fish cheatsheet
# Get only the name of the current directory
basename $PWD
# ~
# Set an array var
set _shows 'The Office' 'It\'s Always Sunny in Philadelphia'
# For loop
for _show in $_shows
echo "I love $_show!"
@marshallvaughn
marshallvaughn / Marked-Frontmatter-Inclusion.md
Created June 3, 2020 14:26
How to include a variable in MMD frontmatter in a Marked document.
title
It Works!

[%title]

@marshallvaughn
marshallvaughn / Scheme.airtable.js
Last active July 16, 2020 23:46
List the tables and fields of each table via script in Airtable.
for (let t of base.tables) {
let md = `#### ${t.name}\n`;
for (let f of t.fields) {
md += `\n- ${f.name}`;
}
output.markdown(md);
}
sfdx force:schema:sobject:describe -s $_OBJECT --json | jq '[.result.childRelationships[] | {field, childSObject, relationshipName}]'
@marshallvaughn
marshallvaughn / getFieldsOnObject.sh
Created September 9, 2020 22:05
sdfx — Field / Object Definition Cookbook
sfdx force:data:soql:query -q "SELECT DataType, QualifiedApiName FROM FieldDefinition WHERE EntityDefinitionId = '$_OBJECTID'" -t
# Get the name of each field on an object, by parsing its JSON description with jq
sfdx force:schema:sobject:describe --json -s account | jq -r '.result.fields[] | .name'