Skip to content

Commit

Permalink
Miscellaneous changes
Browse files Browse the repository at this point in the history
  • Loading branch information
daisylb committed Dec 1, 2022
1 parent d5296ad commit d74b86e
Show file tree
Hide file tree
Showing 18 changed files with 242 additions and 779 deletions.
13 changes: 11 additions & 2 deletions Hammerspoon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ local applicationTimeouts = {
['com.agilebits.onepassword7'] = HOUR,
['com.apple.Notes'] = 3 * HOUR,
['com.apple.iCal'] = 3 * HOUR,
['com.flexibits.fantastical2.mac'] = 3 * HOUR,
['com.postmanlabs.mac'] = 3 * HOUR,
['com.tinyapp.TablePlus'] = 8 * HOUR,
['app.kaleidoscope.v3'] = 8 * HOUR,
['com.apple.iWork.Pages'] = 8 * HOUR,
['com.apple.iWork.Numbers'] = 8 * HOUR,
['com.apple.Preview'] = 3 * HOUR,
['com.apple.shortcuts'] = 3 * HOUR,
['co.gitup.mac'] = 1 * HOUR,
}

hs.window.filter.default:subscribe(hs.window.filter.windowUnfocused, function(window, appName)
Expand Down Expand Up @@ -179,9 +188,9 @@ hs.urlevent.httpCallback = function(scheme, host, params, fullURL)
-- Streamyard: some screen sharing features
-- AWS: uses legacy U2F APIs not supported in Safari
-- Sentry: legacy U2F APIs also
elseif host == 'streamyard.com' then
elseif host == 'streamyard.com' or host == 'meet.google.com' then
hs.urlevent.openURLWithBundle(fullURL, chromiumBrowser)
elseif host == 'aws.amazon.com' or string.match(host, '.*%.aws%.amazon%.com') or host == 'sentry.io' then
elseif host == 'aws.amazon.com' or string.match(host, '.*%.aws%.amazon%.com') then
hs.urlevent.openURLWithBundle(fullURL, nonSafariBrowser)
else
hs.urlevent.openURLWithBundle(fullURL, defaultBrowser)
Expand Down
4 changes: 2 additions & 2 deletions Zsh/env.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
source $HOME/.poetry/env
export ASDF_DIR=/usr/local/opt/asdf/libexec
export ASDF_DIR=/opt/homebrew/opt/asdf/libexec
export ASDF_DATA_DIR=$HOME/Library/asdf
source "$HOME/.cargo/env"
export PATH=~/Library/asdf/shims:~/.local/bin:/usr/local/bin:$PATH
export PATH=~/Library/asdf/shims:~/.local/bin:/opt/homebrew/bin:$PATH
if [ -e /Users/leigh/.nix-profile/etc/profile.d/nix.sh ]; then . /Users/leigh/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer
. "$HOME/.cargo/env"
eval "$(direnv hook zsh)"
9 changes: 9 additions & 0 deletions backups_public.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1S/9jvKC/WLtJ/u8yu1U
mfBMQasrJOIsn6EMGCG+qre2Xa3lVGqsLglX0z4cFUQel8HgjQEqODifj9QSTs0f
Xv8eENO2SXOP7ibz6rNOQem/1aI2Pa1AsOE9UUzHutk8mu9wrTZ8wq/Oiu4y607Y
eGtrY7P+VtCX06grOGy1yPJVT3rkRR4BEhwWdAFErjwwf6lsI4YjQbJG+wKP6z2q
jlNuYVi5VZmFvT/ECMnRwhqAKVrYvVoWV4YlgaKNnBK0d9Ihi3jdVf2YYgpVYTOD
Y2/o22lno9RL2t1OZ0KODTlvNyy6KHGUkmNTDCeHkwg+XWpozKjQNdkzIeTofBJ1
qQIDAQAB
-----END PUBLIC KEY-----
5 changes: 3 additions & 2 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ fish = "~/.config/fish"
"Zsh/rc.sh" = "~/.zshrc"
"Zsh/env.sh" = "~/.zshenv"
"xonsh/_sitecustomize.py" = "~/.local/pipx/venvs/xonsh/lib/python3.9/site-packages/sitecustomize.py"
"~/Library/Mobile Documents/com~apple~CloudDocs/Spelling" = "~/Library/Spelling"

[python]
extra-path = ["/usr/local/opt/libpq/bin"]
library-path = ["/usr/local/opt/openssl/lib"]
extra-path = ["/opt/homebrew/opt/libpq/bin"]
library-path = ["/opt/homebrew/opt/openssl/lib"]
tools = [
"awscli",
"bandit",
Expand Down
6 changes: 3 additions & 3 deletions git/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[user]
name = Leigh Brenecki
email = l@leigh.net.au
name = Daisy Leigh Brenecki
email = daisy@daisy.wtf
[core]
excludesfile = ~/config/git/ignore
autocrlf = input
Expand Down Expand Up @@ -30,7 +30,7 @@
iclean = clean -id
ref = "!git rev-parse HEAD | GREP_COLORS='ms=34;1' grep $(git rev-parse --short=0 HEAD)"
v = describe --dirty --tags
trim = !git branch --merged master | cut -c 3- | grep -v \"^master$\" | xargs git branch -d
trim = !git branch --merged main | cut -c 3- | grep -v \"^main$\" | xargs git branch -d
ignore = "!{ for I in \"$@\"; do echo $I >> .gitignore; done } #"
ignore-local = "!mkdir -p $(git rev-parse --git-dir)/info && { for I in \"$@\"; do echo $I >> .git/info/exclude; done } #"
stashall = stash save --include-untracked
Expand Down
10 changes: 10 additions & 0 deletions git/hook-scripts/post-commit/999-diffstat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python
import subprocess

if subprocess.run(('git', 'show-ref', '--verify', '--quiet', 'refs/heads/main'), stdout=subprocess.DEVNULL).returncode == 0:
main_branch = 'main'
else:
main_branch = 'master'

merge_base = subprocess.run(('git', 'merge-base', main_branch, 'HEAD'), stdout=subprocess.PIPE, encoding='utf8').stdout.strip()
print(subprocess.run(('git', 'diff', '--shortstat', merge_base), stdout=subprocess.PIPE, encoding='utf8').stdout)
7 changes: 0 additions & 7 deletions git/hook-scripts/post-commit/999-diffstat.sh

This file was deleted.

23 changes: 15 additions & 8 deletions git/hook-scripts/pre-commit/010-set-name.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#!/usr/bin/env python3
from pathlib import Path
from os.path import commonpath
from subprocess import check_output, check_call
from pathlib import Path
from subprocess import check_call, check_output

WORK_DIR = Path.home() / "Octopus"
WORK_EMAIL = "daisy.brenecki@octopus.energy"

WORK_DIR = Path.home() / 'CMV'
WORK_EMAIL = 'leigh.brenecki@cmv.com.au'

def is_parent(alleged_parent, alleged_child):
return commonpath((alleged_parent.resolve(),)) == commonpath((alleged_parent.resolve(), alleged_child.resolve()))
return commonpath((alleged_parent.resolve(),)) == commonpath(
(alleged_parent.resolve(), alleged_child.resolve())
)


if is_parent(Path.home() / 'CMV', Path.cwd()):
if check_output(('git', 'config', 'user.email')) != WORK_EMAIL.encode('utf8') + b'\n':
if is_parent(WORK_DIR, Path.cwd()):
if (
check_output(("git", "config", "user.email"))
!= WORK_EMAIL.encode("utf8") + b"\n"
):
print(f"Setting user email to {WORK_EMAIL}")
check_call(('git', 'config', 'user.email', WORK_EMAIL))
check_call(("git", "config", "user.email", WORK_EMAIL))
Loading

0 comments on commit d74b86e

Please sign in to comment.