Skip to content

Instantly share code, notes, and snippets.

View rafpaf's full-sized avatar

Raphael Krut-Landau rafpaf

View GitHub Profile

Keybase proof

I hereby claim:

  • I am rafpaf on github.
  • I am dithyramb (https://keybase.io/dithyramb) on keybase.
  • I have a public key ASCX40zA18gXGQc5vXgdBRhl_x3lA6h7aa_p58mtMzHJ2wo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am rafpaf on github.
  • I am krutlandau (https://keybase.io/krutlandau) on keybase.
  • I have a public key ASBNG88Jk65Am2ZAG_-OgK3ugEdjgJbxJ-Dbzpgv8-7hCwo

To claim this, I am signing this object:

@rafpaf
rafpaf / tcc.md
Last active August 30, 2022 18:43

In my MacBook's system preferences, the Security & Privacy pane won't open, so I can't use the interface to grant applications high-level control over the computer, which lots of them need. So here's a workaround:

Boot into macOS recovery mode, open a Terminal, then:

csrutil disable

Restart your computer. To grant TCC (Transparency, Consent, and Control) access to all applications that have requested it, run this:

@rafpaf
rafpaf / ToggleJestOnlyGlobal.vim
Last active January 25, 2024 15:47
Vim function: toggle ".only" on the current jest test
" This function adds ".only" to the nearest "it(..." block above the cursor, or
" removes ".only" if that is already present. If a "describe..." block is
" nearer above the cursor than any "it..." block, ".only" is toggled on it.
function! ToggleJestOnlyGlobal()
let cursor_position = getpos('.')
let current_line = getline('.')
" Search backwards from the current line for the nearest occurrence of it( or describe(
let match_pos_it = search('\v(it|it\.only)\(', 'bcnW')
# I haven't battle-tested this but it seems to work OK.
#!/usr/bin/env zsh
# If an alert-triggering string appears in the running output of a command,
# show an alert in the tmux window title.
#
# Useful for getting immediate feedback that a command like rollup -w (i.e.
# rollup watch) has noticed an error in your js
javascript:(() => { localStorage.removeItem('metabase-i18n-debug'); window.location.reload(); })()
javascript:(() => { localStorage['metabase-i18n-debug']=true; window.location.reload(); })();