😎 Read more here:
🐦 Look, I'm not saying you should do this.
-
Go to your Twitter profile page.
-
Paste this into the console.
-
Hit enter.
But if you did — and left it running for a long while — it might eventually delete all tweets and retweets from your Twitter account.
| /* | |
| ===== | |
| NOTE: | |
| ===== | |
| ➡️ Actually, if you just want a random ID that works | |
| even outside of SSL (localhost) you can just do this. | |
| */ | |
| // ====================== |
| // Define function. | |
| function waitForDeps(obj, list) { | |
| // Expose promise. | |
| return new Promise((resolve) => { | |
| // Start polling. | |
| const interval = setInterval(() => { | |
| // Get missing. | |
| const listMissing = list.filter(key => !obj[key]); | |
| // All clear? |
| /** | |
| * Gets the median for a list of numbers. | |
| * | |
| * @param {number[]} [listSorted=[]] | |
| * @returns {number} | |
| */ | |
| const getMedian = (listSorted = []) => { | |
| // Get count. | |
| const listCount = listSorted.length; |
| // ====== | |
| // Types. | |
| // ====== | |
| /** | |
| * @template T | |
| * @typedef {{ | |
| * readonly [K in keyof T]: T[K] extends Record<PropertyKey, unknown> | |
| * ? DeepReadonly<T[K]> | |
| * : T[K]; |
| /* | |
| ===== | |
| NOTE: | |
| ===== | |
| This works with LinkedIn's current markup, as of 2024-02-23. | |
| Run it via the dev tools console, while on your "following" page. | |
| https://linkedin.com/mynetwork/network-manager/people-follow/followers | |
| */ |
The following is a message I shared on LinkedIn, posted 2024-02-04. I figured it might be handy to have a public facing page. That way, one does not need to be on LinkedIn to read it. If anyone wants to pick this up as part of a larger content moderation story, you have my permission.
I want to give a shout-out to Florian Eberhart for being especially popular amongst LinkedIn spam bots. I have received several identical messages encouraging me to register for his upcoming event. At the time of this writing, it looks like 14 people are planning to attend.
For work, I made an example of how to cache a fetch promise.
This is different than awaiting a promise and saving the result. Subsequent calls will use the same promise.
It outputs alternating logs:
-
Image object.
-
String "bad dog".
| // Helper function to determine error message. | |
| const getErrorMessage = (error: Error | ErrorEvent | PromiseRejectionEvent): string => { | |
| // Set later. | |
| let message = ''; | |
| // Message string? | |
| if (typeof (error as Error)?.message === 'string') { | |
| message = (error as Error)?.message; | |
| // Reason string? |