Skip to content

Instantly share code, notes, and snippets.

View mvolfik's full-sized avatar
🐧
*penguin noises*

Matěj Volf mvolfik

🐧
*penguin noises*
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mvolfik
mvolfik / svelte_store.rs
Created March 12, 2022 23:19
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
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 {
@mvolfik
mvolfik / shopify-compare-sitemap-api.js
Created June 20, 2022 11:37
For a given shopify store, crawl a list of products from the API, and from sitemaps, and compare if both contain the same products
import { gotScraping } from 'got-scraping';
const fetcher = gotScraping.extend({
proxyUrl: process.env.PROXY_URL,
retry: { limit: 3 },
});
async function main() {
let baseUrl;
try {
const { Actor } = require("apify");
const { Readable } = require("node:stream");
const https = require("node:https");
class MyStream extends Readable {
constructor() {
super();
this.i = 0;
}