Skip to content

Instantly share code, notes, and snippets.

export function createCustomElement(name, templateId) {
const template = document.getElementById(templateId);
class CustomElement extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({ mode: "open" });
shadowRoot.appendChild(template.content.cloneNode(true));
}
}
@Tubeee
Tubeee / coop_receipts.ipynb
Last active September 5, 2024 03:41
This notebook demonstrates how to fetch your Coop receipts (from physical stores, not coop.se) via the API, parse them and analyse the data.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import pdfquery
from PyPDF2 import PdfReader, PdfWriter
from pathlib import Path
import re
from subprocess import Popen, run
SNIPS_FOLDER = Path('/Users/aljas/Documents/KTH/sfdisc/snip/')
#so heres a problem unique to the fy part: the problem texts can be split between pages
def pp(inputpdf, year, n_problems=22, upper_adjustment=5, numbering_suffix=('.',')','a)'), stitch_pagebreaks=True):
@Tubeee
Tubeee / userscript.js
Last active May 28, 2023 17:53
WebRTC Recorder
// ==UserScript==
// @name WebRTC recorder
// @namespace Violentmonkey Scripts
// @version 0.1
// @description Record WebRTC media/data streams
// @author Tubeee
// @match https://*.discord.com/**
// @match https://discord.com/**
// @grant none
// ==/UserScript==