This file contains 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
type Reverse<T> = {[V in T[keyof T] & keyof T]: keyof T} |
This file contains 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
javascript:(_ => { | |
const pre = document.querySelector('pre'); | |
pre.innerHTML = JSON.stringify(JSON.parse(pre.innerHTML), null, 2); | |
})() |
This file contains 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
curl \ | |
-sG \ | |
-d o=TRACKING_IDS \ | |
--data-urlencode q='(owner:niedzielski OR owner:sniedzielski OR owner:pmiazga OR owner:jdrewniak OR owner:jdlrobson OR owner:nray OR owner:phuedx OR owner:volkere) -age:1week -is:wip -message:wip' \ | |
https://gerrit.wikimedia.org/r/changes/| | |
node -e ' | |
JSON.parse(require("fs").readFileSync(0).toString("utf-8").substring(5)) | |
.reduce((sum, val) => ([...sum, ...val.tracking_ids]), []) | |
.filter(({system}) => system === "Phab") | |
.map(({id}) => id) |
This file contains 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
javascript:(_ => { | |
const sheet = document.createElement('style'); | |
sheet.innerHTML = 'img { image-rendering: pixelated; }'; | |
document.head.appendChild(sheet); | |
for(let i = 0; i < frames.length; ++i) { | |
frames[i].document.head.appendChild(sheet); | |
} | |
})() |
This file contains 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
find -not \( \( -name node_modules -o -name .git -o -name dist \) -prune \) -type f -name \*.css| | |
# a | |
while IFS= read -r file; do git mv "$file" "${file%.css}.less"; done | |
# b | |
xargs -rd\\n -i sh -c 'git mv {} $(dirname {})/$(basename {} .css).less' | |
time while IFS= read -ru9 -d $'\n' line; do | |
echo -n "$line" |
This file contains 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
find -not \( -path ./DIRECTORY -prune \) | |
find -not \( \( -name DIRECTORY0 -o -name DIRECTORY1 \) -prune \) | |
# see also: https://stackoverflow.com/q/10747039/970346 |
This file contains 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
node -pe 'JSON.stringify(JSON.parse(require("fs").readFileSync(0)), null, 2)' |
This file contains 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
rg -g\!/resources/dist/ -g\!/i18n/ -g\!/tests/ -g\!/doc/ -t js foo |
This file contains 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
# Find all files not in the current user ownership AND group. | |
sudo find "$DIR" -not \( -uid $(id -u) -gid $(id -g) \) | |
# Recursively change owner and group to current user. | |
sudo chown -R $(id -nu):$(id -ng) "$DIR" |
This file contains 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
sudo sg_map -i | |
df -h /dev/sdX* | |
time sudo shred -v /dev/sdX |
NewerOlder