Skip to content

Instantly share code, notes, and snippets.

Avatar
🐧
*penguin noises*

Matěj Volf mvolfik

🐧
*penguin noises*
View GitHub Profile
View apify-stream-upload-kv-test.js
const { Actor } = require("apify");
const { Readable } = require("node:stream");
const https = require("node:https");
class MyStream extends Readable {
constructor() {
super();
this.i = 0;
}
@mvolfik
mvolfik / shopify-compare-sitemap-api.js
Created Jun 20, 2022
For a given shopify store, crawl a list of products from the API, and from sitemaps, and compare if both contain the same products
View shopify-compare-sitemap-api.js
import { gotScraping } from 'got-scraping';
const fetcher = gotScraping.extend({
proxyUrl: process.env.PROXY_URL,
retry: { limit: 3 },
});
async function main() {
let baseUrl;
try {
@mvolfik
mvolfik / svelte_store.rs
Created Mar 12, 2022
Svelte store contract implemented in Rust using wasm-bindgen. No reason to use to use this on its own, but if you have a larger wasm project, this is handy to use to automatically propagate state changes to the presentation layer
View svelte_store.rs
use std::{cell::RefCell, collections::HashMap, rc::Rc};
use js_sys::{Array, Function};
use wasm_bindgen::{
prelude::{wasm_bindgen, Closure},
JsCast, JsValue,
};
#[wasm_bindgen]
pub struct Writable {
View bugreport.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mvolfik
mvolfik / learningapps.user.js
Created Mar 18, 2021
Userscript to solve learingapps.org exercises
View learningapps.user.js
// ==UserScript==
// @name Learningapps.org solver
// @namespace https://mvolfik.github.io/
// @version 0.1
// @description Add button to autofill learningapps.org
// @author Matěj Volf
// @match https://learningapps.org/tools/*/watch?id=*
// @downloadUrl https://gist.github.com/mvolfik/af53d9f52825bf1c4911d8536980fb43/raw/liveworksheets.user.js
// @updateUrl https://gist.github.com/mvolfik/af53d9f52825bf1c4911d8536980fb43/raw/liveworksheets.user.js
// @grant none
@mvolfik
mvolfik / keybase.md
Created Mar 17, 2021
Keybase identity proof
View keybase.md

Keybase proof

I hereby claim:

  • I am mvolfik on github.
  • I am mvolfik (https://keybase.io/mvolfik) on keybase.
  • I have a public key ASDDaXK1Eg2w4eURSQ3GtP_eu8u4TFM637ckRfvRJg5GZgo

To claim this, I am signing this object:

@mvolfik
mvolfik / liveworksheets.user.js
Last active Apr 23, 2022
Userscript to solve liveworksheets.com exercises
View liveworksheets.user.js
// ==UserScript==
// @name Liveworksheets.com solver
// @namespace https://mvolfik.github.io/
// @version 0.2
// @description Add button to autofill liveworksheets.com
// @author Matěj Volf
// @match https://www.liveworksheets.com/*
// @downloadUrl https://gist.github.com/mvolfik/5d663fd304c38a872813e0576a58573a/raw/liveworksheets.user.js
// @updateUrl https://gist.github.com/mvolfik/5d663fd304c38a872813e0576a58573a/raw/liveworksheets.user.js
// @grant none
@mvolfik
mvolfik / pdf_brochure.py
Last active Jan 24, 2021
Reorder pages of a PDF to allow printing as a brochure
View pdf_brochure.py
import sys, subprocess, tempfile, os.path, warnings
A4 = (595, 842)
source = sys.argv[1]
target = sys.argv[2]
pages = None
page_size = None
View canvas_upgrade.user.js
// ==UserScript==
// @name Canvas tweaks
// @namespace https://mvolfik.github.io/
// @version 0.4
// @description Try to take over the world!
// @author matjey
// @match http://i.protab.cz/mazec/live/
// @downloadURL https://gist.githubusercontent.com/mvolfik/bc928b6334edcca9f3049eb9941ea324/raw/canvas_upgrade.user.js
// @grant GM_addStyle
// @grant unsafeWindow
View kahoot-hotkeys.user.js
// ==UserScript==
// @name Kahoot hotkeys
// @namespace mvolfik.github.io
// @version 0.2
// @description take over the world!
// @author mvolfik
// @match https://kahoot.it/v2/*
// ==/UserScript==
(function() {