Skip to content

Instantly share code, notes, and snippets.

View jordangarrison's full-sized avatar

Jordan Garrison jordangarrison

View GitHub Profile
@jordangarrison
jordangarrison / Requirements for Remote Sharing Clipboard with Terminal Emacs.md
Last active October 19, 2023 02:28
Requirements for Remote Sharing Clipboard with Terminal Emacs.md

Requirements for Remote Sharing Clipboard with Terminal Emacs

So I use Emacs because it is a great tool and I am productive with it. I also code on a development box to avoid x86=>aarch64 compatibility issues with many things on the Mac. Lastly I use NixOS and the Nix package manager on the dev server and Mac respectively.

Problem - clipboards are hard

So I hit a problem. I hadn't noticed it until I was screen sharing and needed to grab some text from the file I was looking at and paste it into chat. I couldn't. The problem with running on a remote box via the terminal is the clipboard exists on the remote server and not locally.

Solution

I found a solution using something that has been around forever, X11. The workflow is a bit tedious, but definitely scriptable at some point.

First I needed to update my NixOS server to allow X11 forwarding.

@jordangarrison
jordangarrison / webdev.md
Last active January 13, 2022 06:29
Web Dev Learning (WIP)

Web Dev Learning

Terms

Term Definition
WebDev General term for web development, its ecosystem and developers
Frontend Programming on the web browser (chrome/safari/firefox...), programs which are executed here
Backend Programming Web endpoints on the server
React/Angular/Vue/Svelte Frontend Frameworks which are popular and worth learning
@jordangarrison
jordangarrison / lpmode.sh
Created December 22, 2021 05:42
Toggle Low Power Mode on MacBook Pro
#!/bin/bash
LP_MODE=$(pmset -g | grep lowpowermode | awk '{print $2}')
if [ "$LP_MODE" == "1" ]; then
echo "🔌 Low power mode is on turning it off"
sudo pmset -a lowpowermode 0
else
echo "🔌 Low power mode is off turning it on"
sudo pmset -a lowpowermode 1
@jordangarrison
jordangarrison / example-sshrc-dotfile.sh
Last active April 4, 2023 01:48
Bring your dotfiles with you over ssh with sshrc
# Save this file as $HOME/.sshrc
# This will take your vimrc in your .sshrc and use it for vim as
# well as append any scripts in your .sshrc.d into your path on login
echo "Hi $USER!"
echo "You are on host $(hostname -f)"
# use sshrc .vimrc instead of system
export VIMINIT="let \$MYVIMRC='$SSHHOME/.sshrc.d/.vimrc' | source \$MYVIMRC"
# Path edits
# Add the $SSHHOME to the path
@jordangarrison
jordangarrison / datadog.1h.py
Created May 28, 2020 16:57
BitBar quick link into datadog dashboards
#!/usr/bin/env PYTHONIOENCODING=UTF-8 /path/to/your/python3/bin/python
from datadog import initialize, api
# For EU the api_host value is different
options = {
'api_key': '<DD_API_KEY>',
'app_key': '<DD_APP_KEY>',
'api_host': 'https://api.datadoghq.com'
}
@jordangarrison
jordangarrison / doom-emacs-python-black-formatter.el
Created May 28, 2020 16:53
Python Black Formatter with Emacs Doom
;; Python Black Formatter
;; package.el
(package! python-black)
;; config.el
(use-package! python-black
:demand t
:after python)
(add-hook! 'python-mode-hook #'python-black-on-save-mode)