Skip to content

Instantly share code, notes, and snippets.

@caseywatts
caseywatts / tweet-the-toot.js
Last active May 2, 2024 06:05
Toot to Twitter Bookmarklet
javascript: (function () {
const tootContents = encodeURIComponent(
document
.getElementsByClassName("detailed-status")[0]
.getElementsByClassName("status__content__text")[0].innerText
);
const twitterLink = `https://twitter.com/intent/tweet?text=${tootContents}`;
window.location.href = twitterLink;
})();
a = `10
13
10
9
14
10`
b = a.split("\n")
c = b.map(a => Number(a))
d = c.sort((a, b) => b-a)
@TameemS
TameemS / debloatMEmu.md
Last active May 2, 2024 06:05
Debloating & Optimizing MEmu

Inspired by this

More of my guides: Debloating LDPlayer - Debloating Nox (Updated)

Edit 22/8/2021: I have updated MEmu and it seems like it reinstalls the apps and re-enables the services. Repeat steps 5, 7, 8, and 9 if you update MEmu.

Debloating MEmu

In my experience, Nox can be quite slow and choppy, and looks like I'm not the only person with this problem. A lot of people say that MEmu performs better than Nox, and I could agree with that. I have no chopping issues with it so far. But like Nox, there are kinda shady stuff going on.

@caseywatts
caseywatts / 0 README.md
Last active May 2, 2024 06:05
Remove "New! Messenger App for Windows" Banner

Other gists & tricks: http://caseywatts.com/gists-and-tricks

Remove Facebook Messenger's "New! Messenger App for Windows" Banner

Bookmarklet

  1. Save this bookmarklet. Right-click on boomarks toolbar Add Page...
    • Name: Remove Messenger Banner (or whatever you like)
    • URL: (paste in the bookmarklet.js contents below)
  2. Each time you open messenger.com, click the bookmarklet and that pesky banner will be gone.

Electron is tricky to get set up on Windows Subsystem for Linux, but it can work!

Four things needed overall:

  1. you need WSL2, not WSL1
  2. you need node, of course, and that part isn't so bad
  3. you need to apt install several dependencies
  4. you need an X Server so it can display the electron GUI over in Windows-land

Setup instructions, in order:

@caseywatts
caseywatts / 0-self-publishing.md
Last active May 2, 2024 06:04
Self-Publishing via Markdown
@caseywatts
caseywatts / gist:653c762abe1cada63d56f66924f3c794
Last active May 2, 2024 06:04
Using Faker in the Node.js REPL

I learned how to open a module in a Node REPL thanks to this StackOverflow post

How to use Faker in a Node.js REPL

  1. npm install --save-dev "@faker-js/faker
    • = install Faker to your repository
    • (I made an empty project folder because idk how to find -g global ones in node)
  2. node --experimental-repl-await
    • = open the Node REPL with the experimental await feature
  3. let { faker } = await import('@faker-js/faker')
@caseywatts
caseywatts / Download-Slack-Profile-Pictures.js
Last active May 2, 2024 06:04 — forked from jonkwheeler/Download-Slack-Profile-Pictures.js
Download Slack Profile Pictures / Images
// 1. Navigate to the Members View
// Enter slack in the browser. https://{insert your team name here}.slack.com/messages/
// Click on the channel you want.
// Click the information icon.
// Expand the members dropdown.
// Click "See All Members"
// 2. Run JS Code To Start
// Copy-paste this whole thing
@igrigorik
igrigorik / index.html
Created June 8, 2013 22:36
XHR streaming example
<p>Hello
<script>
var xhr = new XMLHttpRequest();
xhr.open('GET', '/stream');
xhr.seenBytes = 0;
xhr.onreadystatechange = function() {
console.log("state change.. state: "+ xhr.readyState);