Skip to content

Instantly share code, notes, and snippets.

@edjw
edjw / wrapurls.regex
Last active May 28, 2019 13:50
Wrap bare urls in a:href or markdown link
HTML
Find: (http|ftp|https)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?
Replace: <a href="$0">$0</a>
Markdown
Find: ((http|ftp|https)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?)
Replace: [$1]($1)
// // https://twitter.com/settings/your_twitter_data/twitter_interests
// Lots of discussion and improvement of the original script in the comments
// Here's the best version that works well
// Because Twitter stops the script working after unchecking 50 interests, so you will almost certainly have to run the script multiple times
function sleep(milliseconds) {
return new Promise(function (resolve) {
return setTimeout(resolve, milliseconds);
});
@edjw
edjw / fb_ads_remove.js
Last active April 16, 2020 01:02
A script to remove you from advertisers' FB audience when they uploaded your contact information and it matched the information FB has about you
// This script removes you from advertisers' target lists on Facebook.
// They probably added you to their advert targeting list by uploading a contact list that includes
// your contact information like your email address or phone number.
// Comment below if this doesn't work for you
// *Instructions*
// 1. Go to https://www.facebook.com/ads/preferences
### Keybase proof
I hereby claim:
* I am edjw on github.
* I am edjw (https://keybase.io/edjw) on keybase.
* I have a public key whose fingerprint is 0C91 499B 9B98 42F3 CF0D 0275 214E 3950 A185 26B9
To claim this, I am signing this object: