This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Only tested on macOS, but should work anywhere where you can specify a shell script as the program to open a file with | |
# On macOS, create an Automator app, then create a "Run Shell Script" step and run this script. | |
PID=`grep -oE "([0-9]+)\.0$" "$HOME/.neovide" | rev | cut -c3- | rev` | |
if ps -p $PID > /dev/null; then | |
command nvim --server `cat $HOME/.neovide` --remote-send "<Cmd>NeovideFocus<CR>" | |
# Remove the following line if you don't want the file to open in a new tab | |
command nvim --server `cat $HOME/.neovide` --remote-send "<Cmd>tabnew<CR>" | |
command nvim --server `cat $HOME/.neovide` --remote-send "<Cmd>lua vim.schedule_wrap(vim.cmd.e)('$1')<CR>" | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* NOTE: This won't work to override the system monospace font in every context. However, it's better than nothing. */ | |
/* Follow this guide to implement the stylesheet: https://blog.jim-nielsen.com/2021/custom-style-sheet-in-safari/ */ | |
/* Important your custom fonts from Google Fonts or some other online source, due to security policies this will not work if the font is only installed locally. */ | |
code, pre { | |
font-family: /* Add your custom font family here */ monospace !important; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code, *[class^="inlineCode"] *,*[class^="editor"] * { | |
font-family: /* Add your custom font family here */ monospace !important; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Example { | |
Example1, | |
Example2, | |
} | |
impl Example { | |
fn Example1() { | |
println!("Hello, World!"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function docker { | |
if ! command docker info &> /dev/null; then | |
open -a /Applications/Docker.app | |
echo -n "Waiting for Docker to start ." | |
local slept=0 | |
until [ $slept -eq 15 ] || command docker info &> /dev/null; do | |
sleep 1 | |
((slept++)) | |
echo -n " ." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source this file! | |
docker() { | |
case "$1" in | |
disposable) | |
(shift 1; command docker run --rm -it --name disposable "$@") | |
;; | |
images-grep) | |
command docker images -a --format 'table {{.Repository}}:{{.Tag}} {{.ID}}' | tail -n +2 | sed -nE "s/^$2.* ([A-z0-9]+)$/\\1/p" | |
;; | |
ps-grep) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# NOTE: This command will have to be run again every time the system is updated | |
if ! (sed -n 2p /etc/pam.d/sudo | grep -q "tid") | |
then | |
sudo sed -i -e "2s/^/auth sufficient pam_tid.so\n/" /etc/pam.d/sudo | |
else | |
echo "TouchID already enabled for sudoing" | |
exit 1 | |
fi |