Skip to content

Instantly share code, notes, and snippets.

@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
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 / 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" ¬
@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 / 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>
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();
// ==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==
// ==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==