This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
A script to auto generate this page: https://openlibrary.org/collections/kingdom-of-hawai'i-people | |
*/ | |
class SPARQLQueryDispatcher { | |
constructor(endpoint) { | |
this.endpoint = endpoint; | |
} | |
query(sparqlQuery) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name ! Small Website Fixes | |
// @namespace Small Fixes | |
// @match *://*/* | |
// @grant none | |
// @version 0.0.4 | |
// @author RayBB | |
// @updateURL https://gist.github.com/RayBB/3cc8d1609b83235ecea97477b447aa44/raw/e09ca5366af0d4369d79bdcd450fcde937ecce8a/smallfixes.user.js | |
// @downloadURL https://gist.github.com/RayBB/3cc8d1609b83235ecea97477b447aa44/raw/e09ca5366af0d4369d79bdcd450fcde937ecce8a/smallfixes.user.js | |
// @description Autofills passwords on some sites once they've been entered once. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MAX_RENEWAL = 20; | |
const MAX_INITIAL = 100; | |
function isUnavailable(e){return e.innerHTML.includes("unavailable")} | |
function highRenewalPrice(e){ | |
const container = e.querySelector(".searchResultRowTable .renewsAtContainer"); | |
if (!container) return false; | |
return (parseInt(container.innerText.match(/\d+/)[0]) || 0) > MAX_RENEWAL; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
def findfiles(path, regex): | |
regObj = re.compile(regex) | |
res = [] | |
for root, dirs, fnames in os.walk(path): | |
for fname in fnames: | |
if regObj.match(fname): | |
res.append(os.path.join(root, fname)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For https://www.eacea.ec.europa.eu/scholarships/emjmd-catalogue_en?f%5B0%5D=years_for_emjmd_years_for_emjmd%3A14 | |
// Run in console | |
Array.from(document.querySelectorAll(".ecl-u-flex-grow-1")) | |
.filter(e => e.innerText.includes("locations")) | |
.map(e => { | |
const name = e.querySelector(".ecl-u-type-heading-5").innerText; | |
const website = e.querySelector(".ecl-content-item__description a").href; | |
const countries = e.querySelector(".ecl-description-list__definition").innerText.split("\n"); | |
return `${name}\t${website}\t${countries.join(',')}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Run this on https://reader.miniflux.app/feeds or whatever feeds page you have. | |
All of the feeds with 0 unread entries will be hidden. | |
*/ | |
const items = Array.from(document.querySelectorAll(".item")) | |
items.forEach((item)=>{ if(item.querySelector('[title="Number of unread entries"]').innerText == '0') item.style.display = 'none' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Go to this page: https://www.youtube.com/playlist?list=WL | |
Run the command in the console | |
Paste the output in the terminal and enjoy your downloaded videos | |
*/ | |
copy( | |
Array.from(document.querySelectorAll("#content #thumbnail")) | |
.map(a => a.href) | |
.filter(a=>a!=undefined) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The Movie Database Episode Importer | |
This is a small script that can be run in the console of https://www.themoviedb.org/ to create episodes for a show. | |
*/ | |
function buildFormData(dateString, title, episodeNumber) { | |
const formData = new FormData(); | |
const air_date = (new Date(dateString)).toISOString(); | |
const data = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
printf "%s" "$GAE_CREDENTIALS" > ~/gaecreds.json | |
gcloud auth activate-service-account --key-file ~/gaecreds.json | |
gcloud config set project "$GCLOUD_PROJECT" | |
DEBIAN_FRONTEND=noninteractive | |
# send install logs to null for cleaner logs | |
apt-get install jq >/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
property comment : "adding links to other articles" | |
on run {input, parameters} | |
(* | |
Follow the steps here to get this setup: | |
https://apple.stackexchange.com/questions/175215/how-do-i-assign-a-keyboard-shortcut-to-an-applescript-i-wrote | |
Wikipedia hotkeys here: | |
https://en.wikipedia.org/wiki/Wikipedia:Keyboard_shortcuts | |
This is a small script to help make editing Wikipedia faster |
NewerOlder