Skip to content

Instantly share code, notes, and snippets.

View Eskuero's full-sized avatar

Óliver García Albertos Eskuero

View GitHub Profile
@Eskuero
Eskuero / fix-shortener-tweetdeck.js
Created December 18, 2017 17:07
Script for Greasemonkey that will run every 3 seconds to replace every t.co url with the true location
// ==UserScript==
// @name Fix t.co links on Tweetdeck
// @include *tweetdeck.twitter.com*
// @version 1
// @grant none
// ==/UserScript==
setInterval(function() {
links = document.getElementsByClassName("url-ext");
for (i = 0; i < links.length; i++) {
@Eskuero
Eskuero / undo-retweets.js
Created December 18, 2017 17:16
Retrieve all retweets loaded on your profile page and undo them at once
var rts = document.getElementsByClassName("tweet-context with-icn");
for (i = 0; i < rts.length; i++) {
var children = rts[i].parentElement.parentElement.children[1].childElementCount;
for (j = 0; j < children; j++) {
var clase = rts[i].parentElement.parentElement.children[1].children[j].className;
if (clase == "stream-item-footer") {
rts[i].parentElement.parentElement.children[1].children[j].children[1].children[1].children[1].click();
}
}
}
@Eskuero
Eskuero / tweet-delete.js
Created December 18, 2017 17:20
Doing a Twitter search by "from:yourusername keyword" will list all your tweets with an specified keyword. Once the search page has loaded you can run this script to delete all the found tweets. It may fail if the computer doesn't load the button to delete before we attempt to click it.
var tweets = document.getElementsByClassName("js-actionDelete");
for (i = 0; i < tweets.length; i++) {
tweets[i].click();
document.getElementsByClassName("EdgeButton EdgeButton--danger delete-action")[0].click();
}
@Eskuero
Eskuero / reddirection.js
Created April 26, 2018 18:36
Greasemonkey plugin to automatically redirect new reddit interface to the old one
// ==UserScript==
// @name New Reddit --> Old Reddit
// @include *www.reddit.com*
// @version 1
// @grant none
// ==/UserScript==
var url = window.location.toString();
window.location = url.replace('www.reddit.com', 'old.reddit.com');
@Eskuero
Eskuero / august-security-patch.sh
Created August 9, 2018 17:20
Apply August security patch over LineageOS 14.1 before it gets merged
#!/bin/bash
BASE=$(pwd)
cd $BASE/packages/apps/Messaging;
git fetch https://github.com/LineageOS/android_packages_apps_Messaging refs/changes/36/222636/2 && git cherry-pick FETCH_HEAD;
git fetch https://github.com/LineageOS/android_packages_apps_Messaging refs/changes/36/222636/2 && git cherry-pick FETCH_HEAD;
cd $BASE/system/bt;
git fetch https://github.com/LineageOS/android_system_bt refs/changes/28/222628/2 && git cherry-pick FETCH_HEAD;
@Eskuero
Eskuero / hackerfont.user.js
Last active August 17, 2018 12:34
GreaseMonkey script to allow easy typing of hacker font in niu.moe Download the extension and open the raw link of the following file to install: https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
// ==UserScript==
// @name Hacker buttons
// @version 1
// @include *niu.moe*
// @grant none
// ==/UserScript==
setTimeout(function() {
hackerbutton = document.createElement("img");
hackerbutton.src = "https://cdn.niu.moe/custom_emojis/images/000/004/734/original/934bc263da8d1735.png";
@Eskuero
Eskuero / october-security-patch.sh
Created October 13, 2018 11:30
Apply October security patch over LineageOS 14.1 before it gets merged
#!/bin/bash
BASE=$(pwd)
cd $BASE/.repo/manifests;
git fetch https://github.com/LineageOS/android refs/changes/80/230980/2 && git cherry-pick FETCH_HEAD;
git fetch https://github.com/LineageOS/android refs/changes/81/230981/4 && git cherry-pick FETCH_HEAD;
cd $BASE;
repo sync --force-sync;
cd $BASE/build;
#!/bin/sh
BASE=$(pwd);
cd $BASE/system/bt;
git fetch https://github.com/LineageOS/android_system_bt refs/changes/54/233854/4 && git cherry-pick FETCH_HEAD;
git fetch https://github.com/LineageOS/android_system_bt refs/changes/55/233855/2 && git cherry-pick FETCH_HEAD;
git fetch https://github.com/LineageOS/android_system_bt refs/changes/02/233902/1 && git cherry-pick FETCH_HEAD;
cd $BASE/external/sonivox;
@Eskuero
Eskuero / dms-tweet-delete.js
Created January 30, 2019 13:39
Javascript to automatically delete all the loaded tweets from a private conversation
msgs = document.getElementsByClassName("DMDeleteMessageAction js-tooltip");
button = document.getElementsByClassName("DMDeleteMessage-confirm EdgeButton EdgeButton--danger js-initial-focus")[0];
for (i = 0; i < msgs.length; i++) {
msgs[i].click();
button.click();
}
@Eskuero
Eskuero / april.sh
Created April 7, 2019 11:10
LineageOS 14.1 April security patch
#!/bin/sh
WORKDIR=$(pwd)
cd $WORKDIR/external/libmpeg2;
git fetch https://github.com/LineageOS/android_external_libmpeg2 refs/changes/87/245487/1 && git cherry-pick FETCH_HEAD;
cd $WORKDIR/external/tremolo;
git fetch https://github.com/LineageOS/android_external_tremolo refs/changes/93/245493/1 && git cherry-pick FETCH_HEAD;
cd $WORKDIR/system/bt;