Skip to content

Instantly share code, notes, and snippets.

Last active May 8, 2024 18:08
Show Gist options
  • Save gadenbuie/a14cab3d075901d8b25cbaf9e1f1fa7d to your computer and use it in GitHub Desktop.
Save gadenbuie/a14cab3d075901d8b25cbaf9e1f1fa7d to your computer and use it in GitHub Desktop.

App Install Plan



  • R

  • RSwitch

  • RStudio

  • Packages

    # Install and setup {pak}
    install.packages("pak", repos = "")
    # Install tidyverse
    # and lots of other things...
    pak::pkg_install(c("usethis", "devtools", "here", "styler", "remotes"))
    pak::pkg_install(c("xaringan", "blogdown", "bookdown", "pagedown"))
    my_packages <- c("xaringanExtra", "js4shiny", "shrtcts", "rsthemes", "ermoji", "regexplain")
    pak::pkg_install(paste0("gadenbuie/", my_packages))
    # more RStudio addins



Command Line Tools

General Utilities

Node & npm

Fish Shell


General Things

Stuff I've done that probably doesn't need to be done in any order.

  • Set Flycut clipboard navigator shortcut to Cmd + Option + V
  • Turn on Dock hiding
  • Rename computer: System Prefs > Sharing > Computer Name
  • Add RSwitch to Login Items
  • Alias ll to natls -l: fish> alias -s ll="natls -l"
  • System Preferences > Accessibility
    • Zoom > ☑️ Use scroll gesture with Control keys
    • Enable Hover Text > ☑️ Enable Hover Text with Command

R Config

RSwitch has a command-line tool, which can be symlinked into /usr/local/bin for easy switching on from the terminal. See Using RSwitch.

ln -s /Applications/ /usr/local/bin/rswitch

I'm not exactly sure what went wrong with the R install, but it seems like R and Rscript aren't found. I reinstalled both versions but that didn't work.

From the RSwitch docs I learned that R lives in


so I linked the binary into /usr/local/bin with

ln -s /Library/Frameworks/R.framework/Resources/bin/R /usr/local/bin/R
ln -s /Library/Frameworks/R.framework/Resources/bin/Rscript /usr/local/bin/Rscript

and that fixed R and Rscript from the command line. I wonder if I should do the same for Rcmd, but I guess I'll find out later.

New SSH Key

Run with defaults to add key to ~/.ssh/id_rsa


Copy ~/.ssh/

cat ~/.ssh/ | pbcopy

and add to GitHub to authenticate SSH connections at

Add GitHub PAT to R

# choose scopes
# copy paste PAT

Setup GitHub and gh

# follow instructions
gh auth login

# set default protocol to ssh
gh config set git_protocol ssh


I ended up creating a .dotfiles repo and I put these files into it for now.

├── bin
│   └── create.r
├── git
│   ├── gitconfig
│   └── gitignore
├── iterm2
│   └── Profiles.json
├── r
│   ├── .Rprofile
│   └── .shrtcts.R
├── rstudio
│   ├── keybindings
│   └── rstudio-prefs.json
└── vim
    ├── .viminfo
    └── .vimrc

Create work, play, notes folders

I put my things into ~/work, ~/play and ~/notes.

  • work is for work projects and deliverables.
  • play is for side work projects and experiments
  • notes is for reprexes, tests, keeping track of learning projects

I also typically create a default RStudio project so that it's easy to launch a "scratchpad" R session. It also makes it easy to open the experimental session in a new RStudio window. The project lives in ~/notes/default/.

Mouse Size Service

Once installed, I can switch to Finder and click Finder > Services > Big Mouse to enlarge the mouse for presentations or screen recording

  • Open Automator and create a new Quick Action.
  • Search for AppleScript and then drop Run AppleScript into the workflow.
  • Set the workflow to receive no input
  • Paste the AppleScript code below to replace (* Your script goes here *)
  • Edit the mouse size to a number between 1 (normal) and 4 (big). I pick 4 for big mouse.
  • Save the workflow as "Big Mouse"
  • Duplicate the workflow and adjust the mouse size number to normal size
  • Save this new workflow as "Normal Mouse"
  • Switch to Finder, click Finder in menu bar, then Services, then run "Big Mouse".
  • Give Finder accessibility permissions if the workflow fails
tell application "System Preferences"
	reveal anchor "Seeing_Display" of pane id ""
end tell

tell application "System Events"
	tell process "System Preferences"
		repeat until exists radio button "Cursor" of tab group 1 of group 1 of window 1
			delay 0.1
		end repeat
		click radio button "Cursor" of tab group 1 of group 1 of window 1
		repeat until exists slider "Cursor Size:" of tab group 1 of group 1 of window 1
			delay 0.1
		end repeat
		set theSlider to slider "Cursor Size:" of tab group 1 of group 1 of window 1
		set stash to value of theSlider
		set value of theSlider to 1.0
	end tell
end tell

Debugging AppleScript: this link was essential to determine which UI elements and buttons needed to be scripted in AppleScript (things changed in Big Sur).


brew install --cask \
  font-fantasque-sans-mono font-fantasque-sans-mono-nerd-font \
  font-noto-sans font-noto-serif font-noto-mono font-noto-mono-for-powerline font-noto-emoji \
  font-hasklug-nerd-font font-anonymice-nerd-font font-meslo-lg-nerd-font \
  font-fira-code font-fira-mono font-fira-sans font-fira-sans-condensed \
  font-pt-mono font-pt-sans font-pt-sans-narrow font-pt-serif font-pt-sans-caption font-pt-serif-caption
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment