Silicone oil leaches out of remote control buttons and gradually makes the controller less responsive.
Sunday, July 14, 2024
Monday, July 1, 2024
Twitter: remove all likes
The following block will remove all your Twitter likes, if you are on your profile's /likes page:
{
const sleep = t => new Promise(r => setTimeout(r, t));
let i = 0;
while (true) {
const nodes = document.querySelectorAll('button[data-testid="unlike"]');
if (nodes.length === 0) {
console.log('NOOP');
await sleep(2_000);
if (++i === 10) {
console.log('DONE');
break;
}
} else {
i = 0;
}
let j = 0;
for (const node of nodes) {
console.log(`${++j} / ${nodes.length}`);
node.scrollIntoView();
node.click();
await sleep(2_000);
}
}
}
Wednesday, June 26, 2024
Best zstd compression
The highest zstd compression ratio is achieved with zstd -22 --ultra --single-thread
The -22 gives the highest supported compression level.
The --ultra is needed to get above -19.
The --single-thread preempts some issues with the file being corrupted.
(See: https://github.com/facebook/zstd/issues/3350#issuecomment-1352455838)
The -22 gives the highest supported compression level.
The --ultra is needed to get above -19.
The --single-thread preempts some issues with the file being corrupted.
(See: https://github.com/facebook/zstd/issues/3350#issuecomment-1352455838)
Monday, May 13, 2024
Twitter: collect all links to posts on a page
The following snippet executed in the Developer Console will help you collect all the links to individual posts on a profile. Once the script has been executed, all you'll need to do is to scroll down (or navigate from post to post using the "J" key).
window.links = new Set();
window._updateLinks = () => {
Array.from(document.querySelectorAll('a > time'))
.map(node => node.parentNode.href)
.forEach(link => window.links.add(link));
}
window._handleScroll = () => {
_updateLinks();
console.log("Links collected:", window.links.size);
}
window.addEventListener('scroll', _handleScroll);
Once you're ready to collect the data, you can copy it to the clipboard using:
copy(Array.from(window.links).join("\n"));
This will copy the links to all the posts you've scrolled through, one link per line.
Useful e.g. when wanting to archive the content from a profile.
Friday, February 23, 2024
Friday, February 9, 2024
Subscribe to:
Posts (Atom)