Skip to content

Instantly share code, notes, and snippets.

View marshallvaughn's full-sized avatar
🛠️

Marshall Vaughn marshallvaughn

🛠️
View GitHub Profile
@marshallvaughn
marshallvaughn / Git Cookbook.md
Last active January 31, 2023 20:57
Collection of quick-reference snippets for everyday use with git.
# Get the last commit SHA
git log -1 --format='%H' # long sha
git log -1 --format='%h' # short sha

Get the branch name only.

git rev-parse --abbrev-ref HEAD
@marshallvaughn
marshallvaughn / dev-resources.md
Last active December 7, 2021 18:49
dev-resources

Dev Resources

A simple collection of scripts/sites I find useful day-to-day. Feel free to use or copy as you wish.

# 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'
@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
sfdx force:schema:sobject:describe -s $_OBJECT --json | jq '[.result.childRelationships[] | {field, childSObject, relationshipName}]'
@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);
}
@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 / 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!"
-- 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 / 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