Skip to content

Instantly share code, notes, and snippets.

@Matojeje
Matojeje / Monogolf auto-timer.ahk
Created July 23, 2023 22:12
This AutoHotkey script tracks the duration of Monogolf Challenge mode runs by watching your phone's screen using scrcpy
; Monogolf auto-timer by Mato, version 1.0
; Prerequisites: AutoHotKey v1, ScrCpy on PATH
; ===== Info =====
; Single beep means that the run start/end was detected
; Very high beep means that you reached a new high score in this session
; Double beep means that the window isn't in foreground, so no tracking will happen
; Press Esc to stop the script (also possible from the taskbar notification tray)
; Make sure to tweak the settings to fit your setup first, especially lines 44 and 73
@Matojeje
Matojeje / djmt.html
Created April 4, 2023 03:36
DjMuffinTops presentation bookmarklet
javascript:(function(){document.body.innerHTML+=`<djbutton style="position: fixed; bottom: 0px; right: 0px; width: 50vmin; perspective: 100vmin;"><img src="https://cdn.discordapp.com/attachments/473963532782665738/1092641417240793169/dj_button.png" style="width: 100%"><canvas style="position: absolute; background: white -moz-element(#${[...document.querySelectorAll('body *')].find(el => el.id && el.tagName !== 'SCRIPT' && !el.closest('script') && el.tagName !== 'LINK' && !el.closest('link') && el.tagName !== 'STYLE' && !el.closest('style'))?.id}) no-repeat scroll center center / contain; right: 6%; transform: rotateY(-34deg) rotateZ(1deg); top: 14%; height: 37%; width: 42%;" width="192" height="108"></canvas></djbutton>`})();
@Matojeje
Matojeje / buppy.js
Created December 2, 2022 02:11
the puppy regular expression
const buppy = /^(?:[pb](?:[bwluh]*)?[uae]+p*|p(?:[bwluh]*)?[uae]+([pb])\1*|([pb])(?:b?[lwuh]*)?\2[uae]+|[pb]u+)(?:[yi]+?e?|e+h?)?[sz]?$/gm
for (pup of "puppy,buppy,bupy,pupy,pup,puy,up,uppy,ppuy,pbuy,bbuy,pabbi,puppeeh,bwappy,bluppy,baby,ppuies".split(",")) console.info(pup, !!pup.match(buppy))
/* by MatoCookies :: 2nd of December 2022 */
@Matojeje
Matojeje / stickerpack.py
Created January 30, 2020 21:21
Converts JSON files exported from bodymovin AE plugin to TGS (Telegram sticker)
import argparse
import gzip
parser = argparse.ArgumentParser(description="Packs JSON files exported by Bodymovin into TGS files for Telegram.\nIt's literally just gzip.", epilog="By Mato.")
parser.add_argument("filename", type=str, help="The JSON file to convert")
filename = vars(parser.parse_args())["filename"]
print("Opening file")
# http://xahlee.info/python/gzip.html
@Matojeje
Matojeje / Eko.md
Last active October 14, 2020 09:05
Sešit do ekonomiky, 3. a 4. ročník

Ekonomika

2019/2020

Tržní ekonomika

V ČR od roku 1989. Založena na pěti předpokladech:

  1. Konkurence (střet nabídky a poptávky na trhu)
  2. Zdravá míra nezaměstnanosti (3%)
  3. Snaha dosáhnout zisku (+ rezervy na období bez zisku)
  4. Soukromé vlastnictví prostředků určených k podnikání (veškerý majetek používaný k podnikání musí být zaevidován)
for(x="",i=65;i<91;i++)x+=`(?=.*${String.fromCharCode(i)})`
arguments.forEach(a=>{RegExp(x,"i").test(a)&&print(a)})
# -*- coding: utf-8 -*-
"""
Úkoly
1. Vytvořte program pro výpis druhých a třetích mocnin čísel od 1 do 10. Výpis zobrazte ve tvaru:
1^2 = 1 1^3 = 1
2^2 = 4 2^3 = 8
atd.
2. Vytvořte program pro simulaci házení kostkou, přičemž si uživatel volí, kolikrát chce házet. Program následně zobrazí postupně hozená čísla a na závěr vypočítá jejich průměrnou hodnotu.
@Matojeje
Matojeje / LeapYears.js
Created December 14, 2019 11:29
Leap years codegolf - prints all leap years from 1800 to 2400 inclusive
for(i=1800;i<2401;i++){!(i%4)&&(i%100)^!(i%400)?print(i):0}
@Matojeje
Matojeje / FizzBuzz.js
Created December 12, 2019 18:38
FizzBuzz codegolf
for(i=1;i<101;i++){a="";i%3==0?a+="Fizz":0;i%5==0?a+="Buzz":0;print(a||i)}
@Matojeje
Matojeje / gmap.html
Last active March 16, 2018 22:37
Google Maps API TOS
<html>
<head>
<link rel="stylesheet" href="https://developers.google.com/_static/748d82c5d5/css/devsite-google-blue.css">
<link href="https://developers.google.com/maps/styles/common.css" rel="stylesheet" type="text/css">
<style>
h2 {
border-bottom: 0;
font: 20px/28px Roboto, sans-serif;
font-weight: bold;