Skip to content

Instantly share code, notes, and snippets.

View niedzielski's full-sized avatar
🥨

stephen niedzielski

🥨
View GitHub Profile
@niedzielski
niedzielski / github-toggle-outdated.js
Last active December 26, 2017 20:10
Bookmarklet to toggle outdated GitHub pull request comment visibility.
javascript:(_ => { document.querySelectorAll('.show-outdated-button').forEach(button => button.click()) })()
@niedzielski
niedzielski / gerrit-toggle-comments.js
Last active December 26, 2017 20:11
Bookmarklet to toggle visibility of Gerrit comments.
javascript:(_ => {
document.querySelectorAll('.CodeMirror-linewidget')
.forEach(comment => comment.style.display = comment.style.display === 'none' ? '' : 'none')
})()
@niedzielski
niedzielski / find-excluding-subdirectory.sh
Last active April 27, 2019 16:09
Find excluding one or more subdirectories.
find -not \( -path ./DIRECTORY -prune \)
find -not \( \( -name DIRECTORY0 -o -name DIRECTORY1 \) -prune \)
# see also: https://stackoverflow.com/q/10747039/970346
@niedzielski
niedzielski / npm-rebase.sh
Last active December 26, 2017 20:12
Rebase an npm repo and test each unmerged commit.
git rebase -x 'npm -s t' origin/master
@niedzielski
niedzielski / prompt-to-continue.sh
Last active December 26, 2017 20:12
Prompt to continue.
read -p '<enter> to continue, <ctrl-c> to abort: ' answer
@niedzielski
niedzielski / spaces.mk
Last active December 26, 2017 20:12
Use spaces instead of tabs in make v3.82+.
empty :=
space := $(empty) $(empty)
.RECIPEPREFIX := $(space)
all:
@echo 'hello world!'
#^ these are spaces not tabs.
@niedzielski
niedzielski / tabs-to-spaces.sh
Last active December 26, 2017 20:13
Convert tabs to spaces.
find -not \( \( -name node_modules -o -name .git \) -prune \) -type f|
xargs -rd\\n sed -ri 's%\t% %g'
@niedzielski
niedzielski / eslint-fix.sh
Last active December 26, 2017 20:13
Apply automated lint fixes.
eslint --cache --max-warnings 0 --report-unused-disable-directives --ext .ts,.tsx --fix .
@niedzielski
niedzielski / mw-toggle-debug.js
Last active December 26, 2017 20:14
Bookmarklet to toggle MediaWiki debug mode.
javascript:(_ => { const url = new URL(window.location.href); url.searchParams.set('debug', url.searchParams.get('debug') !== 'true'); window.location.href = url.toString() })()
@niedzielski
niedzielski / mw-toggle-visual-event-logging.js
Last active December 26, 2017 20:14
Toggle MediaWiki visual Event Logging notifications bookmarklet.
javascript:(_ => new mw.Api().saveOption('eventlogging-display-web', mw.user.options.get('eventlogging-display-web') !== '1' ? '1' : '0'))()