Skip to content

Instantly share code, notes, and snippets.

View lilianalillyy's full-sized avatar

Mia Pilchová (Liliana) lilianalillyy

View GitHub Profile
@lilianalillyy
lilianalillyy / README.md
Last active May 26, 2025 09:09
Moneta Table Export

While Moneta supports data exports in CSV, some places (like card blocks) cannot be exported. This script parses the table's HTML and allows you to read your data programmatically, export it as json or csv.

Usage:

// any variable name can be used
const table = /*<contents of script>*/

table.data // parsed data
@lilianalillyy
lilianalillyy / moving-and-upgrading-plausible-2.md
Last active December 26, 2024 22:13
Plausible 2.0->2.1 transition and moving to new server

Moving Plausible to a new server + 2.1 upgrade

This is the summary of steps I've taken when migrating my Plausible 2.0 instance to a new server and then upgrading it to 2.1.

On the old server

  1. Shutdown Postgres & Clickhouse before backup
docker compose down plausible_db
docker compose down plausible_events_db
@lilianalillyy
lilianalillyy / fileclient.js
Created March 19, 2024 12:52
Cross-origin data
// debugging element to see data
const filesEl = document.createElement("pre");
filesEl.textContent = "waiting for files...";
filesEl.setAttribute("style", "z-index: 9999;background-color: #fff;")
document.body.prepend(filesEl);
const popup = window.open("https://fileserver.com/shared/handshake-files", 'popupWindowName', 'width=200,height=200');
setTimeout(() => {
console.log("fileserver is ready, sending request for files");
const { exec } = require("child_process");
const { statSync, existsSync, readFileSync } = require("fs");
const path = require("path");
const { sync: glob } = require("glob");
const DEPENDENCY = "axios";
const reinstall = (pth) => {
return new Promise((resolve, reject) => {
const packageJsonPath = path.join(pth, "package.json");
@lilianalillyy
lilianalillyy / plausible.gs
Last active January 3, 2024 18:17
Plausible Stats
const TOKEN = "";
const PLAUSIBLE_URL = "https://plausible.acme.com";
const SITES = [
{
col: "C",
siteId: "acme.com"
},
{
col: "D",
siteId: "softwarebyacme.com"
@lilianalillyy
lilianalillyy / chocco.js
Created December 28, 2023 14:38
Fuck Moodle (based on Fuck Apex Learning)
(() => {
const OPENAI_TOKEN = "";
const MODEL = "gpt-4-1106-preview";
//const MODEL = "gpt-3.5-turbo"
const ADDITIONAL_QUERY = "These questions are asked within the context of the Czech Republic and it's law.";
const QUERY_TASK = `Task: Identify the correct option (or options in case of a multiple-answer question) that best answers the provided question and provide your answer in the format: {"letters": ["Letter(s) to the correct options"], "explanation": "[Few words explaining why the choice is correct]", "certainty": "[How certain, in %, are you that the answer is correct]"}. ${ADDITIONAL_QUERY}`.trimEnd();
@lilianalillyy
lilianalillyy / choccy.js
Created December 11, 2023 02:23
Fuck Apex Learning
// const fetch = require("node-fetch")
let createPlaceholderAnswer = (letter, description) => ({
value: `${letter}. ${description}`,
letter,
select: () => {
console.log("debug: called select() in answer", letter);
},
});
const map = new Map();
const directory = document.querySelector(".directory");
const container = document.createElement("div");
let currentIndex = -1;
const getNext = () => { currentIndex++; return map.get(currentIndex)?.href ?? null; }
directory.prepend(container);
@lilianalillyy
lilianalillyy / domain-user-UserModule.ts
Last active April 30, 2023 20:39
TL;DR: Repositories & Prisma minus the boilerplate
import { PrismaModule } from "@infra/prisma/PrismaModule";
import { Module } from "@nestjs/common";
import { UserRepository } from "./UserRepository";
import { PrismaRepository } from "@infra/prisma/PrismaRepository";
@Module({
imports: [
PrismaModule.forRoot(
UserRepository,
"user", // base repository, can be injected with @InjectRepository("user")
@lilianalillyy
lilianalillyy / avatars.js
Created April 22, 2023 12:48
Simply Plural - Move to avatar url
const axios = require("axios");
const { createWriteStream, existsSync, mkdirSync } = require("fs");
const path = require("path");
const client = axios.create({
baseURL: 'https://api.apparyllis.com:8443',
headers: {
Accept: 'application/json',
Authorization: '<TOKEN HERE>',
},