Skip to content

Commit

Permalink
WIP changes from a while ago. Last modified on:
Browse files Browse the repository at this point in the history
- 2024-02-21 19:53:23 '.aliases'
- 2024-02-15 11:21:02 '.exports'
- 2024-02-27 16:01:27 '.gitconfig'
- 2024-02-22 11:00:38 'bin/git_diff_image'
- 2023-11-28 17:56:29 'brew.sh'
- 2024-02-16 15:54:28 'fish/aliases.fish'
- 2024-02-15 11:22:09 'fish/chromium.fish'
- 2024-02-27 16:01:16 'fish/config.fish'
- 2023-12-06 16:27:38 'fish/functions.fish'
  • Loading branch information
paulirish committed Feb 29, 2024
1 parent 63fbda5 commit ae3ff13
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .aliases
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,10 @@ alias fs="stat -f \"%z bytes\""
# Update installed Ruby gems, Homebrew, npm, and their installed packages
alias brew_update="brew -v update; brew upgrade --force-bottle --cleanup; brew cleanup; brew cask cleanup; brew prune; brew doctor; npm-check -g -u"
alias update_brew_npm_gem='brew_update; npm install npm -g; npm update -g; sudo gem update --system; sudo gem update --no-document'


alias xpraserver='xpra start --printing=no --systemd-run=no --daemon=no :110'

# weird ass behavior without this.
alias watchexec="watchexec --project-origin ."

1 change: 1 addition & 0 deletions .exports
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ export LESS_TERMCAP_us=$(printf '\e[04;36m') # enter underline mode
export FZF_DEFAULT_COMMAND='fd'
export FZF_CTRL_T_COMMAND='fd'
export FZF_CTRL_T_OPTS="--preview 'bat -n --color=always {} 2>/dev/null || tree -C {}'"

2 changes: 1 addition & 1 deletion .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
mergeorigin = !"git merge origin/$(git mainormaster)"

# Essentially GitHub's compare view: show all 'ahead' changes (incl working tree) vs the merge-base
diffbranch = !"git diff $(git diffbase)"
diffbranch = !"git diff -w $(git diffbase)"
# Diff of branch that's not checked out. Doesn't include working tree (but obv doesnt need to)
diffbranch-that = !"git diff origin/$(git mainormaster)...\"$1\" #"
# Show commit log of unique commits of this branch (not on main)
Expand Down
11 changes: 11 additions & 0 deletions bin/git_diff_image
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

set -euo pipefail

# this is installed by way of ~/.gitattributes



# if we're running within fzf dont do this
if [ -n "${FZF_COLUMNS-}" ]
then
exit 0
fi


name="$1"
f1="${2-/dev/null}"
f2="${5-/dev/null}"
Expand Down
9 changes: 1 addition & 8 deletions brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,7 @@ brew install shellcheck # linting for .sh files

# mtr - ping & traceroute. best.
brew install mtr

# allow mtr to run without sudo
# https://github.com/traviscross/mtr/issues/204#issuecomment-487325796
sudo chmod 4755 $location_of_mtr-packet
# on my machine i have a `/usr/local/sbin/mtr-packet` and root owns local/sbin. (thx google!?)
# thus, i dont use the homebrew mtr.


# `abbr mtr "sudo mtr"` to avoid forgetting.

# Install other useful binaries
brew install the_silver_searcher # ack is an alternative, tbh i forget which i like more.
Expand Down
10 changes: 7 additions & 3 deletions fish/aliases.fish
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ subcommand_abbr git dbt "diffbranch-that"
subcommand_abbr npm i "install"
#subcommand_abbr pnpm i "install"

abbr mtr "sudo mtr"


# is it a `main` or a `master` repo?
Expand Down Expand Up @@ -147,7 +148,10 @@ alias reportunit 'yarn jest (find report -iname "*-test.js" | grep -v axe)'
# pretty sure watchexec has just won my heart after years of using `entr`
alias reportwatch 'watchexec "node build/build-report-components.js && node build/build-report.js --psi && node build/build-sample-reports.js && echo \$(date) && yarn eslint --fix report/renderer/components.js" && bash core/scripts/copy-util-commonjs.sh'

# dt. rpp
alias rppunit 'npm run unittest -- --expanded-reporting --mocha-fgrep=Processor\|Timeline\|trace\|Trace\|Appender\|Handler\|Performance'
alias rppinter 'npm run interactionstest -- --test-file-pattern="*/performance/**"'
alias rppscreen 'third_party/node/node.py --output scripts/test/run_test_suite.js --config test/interactions/test-runner-config.json --mocha-fgrep "[screenshot]" --test-file-pattern="*/performance/**"'

alias rppunit 'npm run auto-unittest -- --expanded-reporting --mocha-fgrep=Processor\|Timeline\|trace\|Appender\|Handler\|Performance'
alias rppinter 'HTML_OUTPUT_FILE=rppscreenshots.html npm run interactionstest -- --test-file-pattern="*/performance/**"'
alias rppscreen 'HTML_OUTPUT_FILE=rppscreenshots.html third_party/node/node.py --output scripts/test/run_test_suite.js --config test/interactions/test-runner-config.json --mocha-fgrep "[screenshot]" --test-file-pattern="*/performance/**"'

abbr xpraclient "xpra attach --video-scaling=off --desktop-scaling=off --dpi=96 --ssh=/usr/bin/ssh 'ssh://glurp/:110'"
11 changes: 9 additions & 2 deletions fish/chromium.fish
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ function dtb --description "build devtools with a watch loop"
eval $cmd
end

function dtbw --description "use watch_build.js"
cd ./(git rev-parse --show-cdup)

# dont let vpython use a 2.7.. seems to only affect this dude
VPYTHON_BYPASS="manually managed python not supported by chrome operations" node scripts/watch_build.js
end

# https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md
# # Avoid the startup dialog for 'Chromium wants to use your confidential information stored in "Chromium Safe Storage" in your keychain'
# # Avoid the startup dialog for 'Do you want the application “Chromium.app” to accept incoming network connections?'
Expand Down Expand Up @@ -150,7 +157,7 @@ end
function glurpgrab --description "dl mac-cross build from glurp"
glurpgrab0

maccr
maccr-flagged
end

function maccr
Expand All @@ -174,7 +181,7 @@ function crflags
--disable-extensions --disable-component-extensions-with-background-pages --disable-background-networking --disable-component-update \
--disable-client-side-phishing-detection --disable-sync --metrics-recording-only --disable-default-apps --mute-audio --no-default-browser-check \
--no-first-run --disable-backgrounding-occluded-windows --disable-renderer-backgrounding --disable-background-timer-throttling --disable-ipc-flooding-protection \
--disable-hang-monitor --enable-logging=stderr $clutch_chrome_flags --user-data-dir=\(mktemp -d "$TMPDIR/chrome-profile-XXXXX"\)
--disable-hang-monitor $clutch_chrome_flags --user-data-dir=/tmp/glurp-mac-cross --enable-logging=stderr
# these two are also good, but tricky to escape for inclusion here: --vmodule='device_event_log*=1' --force-fieldtrials='*BackgroundTracing/default/'
end

Expand Down
6 changes: 6 additions & 0 deletions fish/config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ set -g fish_pager_color_progress cyan
# pull in all shared `export …` aka `set -gx …`
source ~/.exports

# ctrl-b invokes the fancy boi. but this doesnt really work right.
bind \cb git-recent-with-fzf-and-diff
if bind -M insert > /dev/null 2>&1
bind -M insert \cb git-recent-with-fzf-and-diff
end

# TODO debug this
# this currently messes with newlines in my prompt. lets debug it later.
# test -e {$HOME}/.iterm2_shell_integration.fish ; and source {$HOME}/.iterm2_shell_integration.fish
7 changes: 3 additions & 4 deletions fish/functions.fish
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,11 @@ function server -d 'Start a HTTP server in the current dir, optionally specifyin
# arg can either be port number or extra args to statikk
if test $argv[1]
if string match -qr '^-?[0-9]+(\.?[0-9]*)?$' -- "$argv[1]"
echo $argv[1] is a number
set port $argv[1]
statikk --open --port "$port"
# fancy argv thing to pass all remaining args. eg `server --cors --jsprof`
statikk --open --port $argv[1..-1]
else
echo "not a number"
statikk --open $argv[1]
statikk --open $argv[1..-1]
end

else
Expand Down

0 comments on commit ae3ff13

Please sign in to comment.