Skip to content

Instantly share code, notes, and snippets.


myke MikulasZelinka

View GitHub Profile
View google_photos_best_video_quality.user.js
// ==UserScript==
// @name Auto best quality for videos in Google Photos
// @namespace
// @version 0.1
// @description Tampermonkey script that selects the best quality for all embedded youtube videos when the page/player is loaded (at least those that are served with the same URL as those in Google Photos).
// @author Mikuláš Zelinka
// @match*
// @grant none
// ==/UserScript==
MikulasZelinka /
Created Aug 5, 2020
MPMP: The Marching Band Problem
# python one-liner solution to
print(next(x for x in range(1_000_000) if len([y for y in range(1, x + 1) if x % y == 0]) == 64))
MikulasZelinka / th_before_last_fr.txt
Created Jun 29, 2020
The Thursday before the last Friday in each month
View th_before_last_fr.txt
freq: RRule.MONTHLY,
byweekday: [RRule.TH],
bymonthday: [-8, -7, -6, -5, -4, -3, -2]
MikulasZelinka /
Last active May 28, 2021
pytorch: handling sentences of arbitrary length (dataset, data_loader, padding, embedding, packing, lstm, unpacking)
sort-of minimal end-to-end example of handling input sequences (sentences) of variable length in pytorch
the sequences are considered to be sentences of words, meaning we then want to use embeddings and an RNN
using pytorch stuff for basically everything in the pipeline of:
dataset -> data_loader -> padding -> embedding -> packing -> lstm -> unpacking (~padding)
based mostly on:
pytorch version 1.4.0
gist url:
MikulasZelinka /
Created Sep 20, 2017
Infinitely many people gather to wrap their heads around a coin-flipping game
# Game: n people, each person flips a coin until they get heads
# Question: what is the ratio of heads after the game ends?
n = 1024
heads = 0
tails = 0
# how many rounds does each game last on average (just for fun):
iterations = 0