Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name Show Image Alt Text
// @namespace http://tampermonkey.net/
// @version 0.1
// @description https://www.reddit.com/r/chrome_extensions/comments/qhpcw4/looking_for_an_extension_that_will_always_show/
// @author You
// @match http*://*
// @grant none
// ==/UserScript==
// ==UserScript==
// @name Filter Youtube Homepage by Age
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Remove Youtube videos from homepage that are over x years old
// @author @Glench
// @match https://www.youtube.com/
// @icon https://www.google.com/s2/favicons?domain=youtube.com
// @grant none
// ==/UserScript==
function is_loading() {
return document.querySelector('#UpdateProgress3').getAttribute('aria-hidden') == 'false';
}
function wait_till_load_done() {
setTimeout(function() {
if (!is_loading()) {
scrape_table()
} else {
wait_till_load_done();
@Glench
Glench / example.svelte
Last active December 19, 2020 19:02
An idea for how SvelteKit could bridge the front-end/back-end gap more elegantly
<script context="backend">
// /routes/index.svelte
import db from '/db';
export async function get(req, abort, redirect) {
const user = await db.User.findOne({where: {id: req.query.user_id}});
return {user}
}
</script>
@Glench
Glench / scratch_fullscreen_cover.js
Last active April 14, 2020 17:36
Set Scratch UI to black
{
// sets everything but stage to black on full-screened https://scratch.mit.edu/projects/editor/
const stage = document.querySelector('[class^="stage_stage-bottom-wrapper"]')
const rect = stage.getBoundingClientRect();
const pageHeight = document.documentElement.scrollHeight;
var leftCover = document.createElement('div');
@Glench
Glench / body_reminder.py
Created April 26, 2019 19:50
A meditation reminder app when I'm using the computer
# This Python file uses the following encoding: utf-8
import subprocess
import time
breathing_time = 30 # seconds
interval_between_breathing = 25 * 60 # seconds
applescript = """
display dialog "Breathe and make a home of your body" ¬
import play
@play.when_any_key_pressed
def do(key):
text = play.new_text(':(', y=play.screen.bottom)
text.start_physics(x_speed=play.random_number(-20,20), y_speed=100, bounciness=.3)
play.start_program()
@Glench
Glench / categories.txt
Last active December 31, 2018 14:23
Wikipedia categories ordered by number of pages (5 page minimum), 2018-12-31
Living people 887246
Year of birth missing (living people) 70369
American films 48785
Association football midfielders 45613
Place of birth missing (living people) 43381
English-language films 40342
Association football defenders 35650
Taxonomy articles created by Polbot 32839
Association football forwards 32393
English Football League players 23766
@Glench
Glench / calendar_facts.json
Created December 18, 2017 19:03
XKCD #1930 Calendar Facts Tracery script
{
"origin":["Did you know that #start# #next# because of #reason#? Apparently #fact#"],
"start":["the #springfall# equinox", "the #wintersummer# #solsticeolympics#", "the #earliestlatest# #sunrisesunset#", "daylight #saving# time", "Leap #dayyear#", "Easter", "the #moontype# Moon", "Toyota Truck Month", "Shark Week"],
"next":["happens #relativetime# every year", "drifts out of sync with the #synctypes#", "might #happen# this year"],
"springfall":["spring", "fall"],
"wintersummer": ["winter", "summer"],
"solsticeolympics": ["solstice", "olympics"],
"earliestlatest": ["earliest", "latest"],
"sunrisesunset": ["sunrise", "sunset"],
"saving": ["saving", "savings"],
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.