Skip to content

Instantly share code, notes, and snippets.

View Jaakkonen's full-sized avatar

Jaakko Sirén Jaakkonen

  • Helsinki, Finland
View GitHub Profile
@Jaakkonen
Jaakkonen / dokabiliteetti.py
Created August 13, 2025 10:59
Script to find the cheapest alcohol from Alko.fi
import requests
import polars as pl
import os
PRODUCTS = "https://www.alko.fi/INTERSHOP/static/WFS/Alko-OnlineShop-Site/-/Alko-OnlineShop/fi_FI/Alkon%20Hinnasto%20Tekstitiedostona/alkon-hinnasto-tekstitiedostona.xlsx"
PRODUCT_FILE = "alkon-hinnasto-tekstitiedostona.xlsx"
def load_data():
if not os.path.exists(PRODUCT_FILE):
response = requests.get(PRODUCTS)
@Jaakkonen
Jaakkonen / index.ts
Last active July 8, 2024 23:47
NodeJs commonjs import challenge
import { UndirectedGraph } from "graphology";
const a = new UndirectedGraph();
@Jaakkonen
Jaakkonen / poc.md
Created July 8, 2024 23:18
Importing CJS module from ESM context
// Old code when having "type": "commonjs" in package.json and "module": "commonjs" in tsconfig.json
import { UndirectedGraph } from 'graphology'

Now changing to "type": "module" in package.json causes following error report:

import { UndirectedGraph } from 'graphology';
         ^^^^^^^^^^^^^^^
SyntaxError: Named export 'UndirectedGraph' not found. The requested module 'graphology' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
@Jaakkonen
Jaakkonen / coc_clan.py
Created June 27, 2024 21:15
Clash of clans clan search
#!/bin/python
import re
import statistics
from typing import Any, Callable
import requests
import os
from urllib.parse import quote
from cachecontrol import CacheControl
from cachecontrol.caches.file_cache import FileCache
@Jaakkonen
Jaakkonen / dump_nocfo.py
Created June 27, 2024 21:01
Extract NoCFO.io attachements
import requests
import os
from pathlib import Path
token = os.environ["NOCFO_TOKEN"]
y_tunnus = os.environ["NOCFO_VAT_CODE"]
s = requests.Session()
s.headers.update({"Authorization": token})
results = []
next_page = 1
@Jaakkonen
Jaakkonen / notify.py
Created June 18, 2024 07:26
Minimal DBus Wire protocol/format implementation and packet creator
"""
Opens a DBus connection and does equivalent of
busctl --user call org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications Notify 'susssasa{sv}i' "" 0 "ata" "ata" "ata" 1 "kiisu" 1 "hint" u 10 1000
"""
import socket
import struct
import os
from pathlib import Path
@Jaakkonen
Jaakkonen / nordea_statement_parser.py
Last active March 30, 2024 23:35
Nordea Finnish machine format (html) bank statement parser - Nordea konekielisen tiliotteen (HTML) lukija Python
"""
Parser for Finnish Nordea html format bank statements.
File names are commonly in the name format:
Konekielinen-tiliote(YY-MM-DD).html
Yields categorized rows with deposited/withdrawn sums, reference numbers, messages, dates, etc. extracted with regexes.
Access the rows with the rows dictionary using the RowType enum as the key, and get the properties of the row with the groupdict() method of the match object.
Example:
@Jaakkonen
Jaakkonen / antimatter_dimensions_challenge9_purchaseorder.py
Created August 17, 2023 22:39
Antimatter dimensions challenge 9 script to avoid price conflicts
increments = {
"Tickspeed": 1,
"1st": 3,
"2nd": 4,
"3rd": 5,
"4th": 6,
"5th": 8,
"6th": 10,
"7th": 12,
"8th": 15,
@Jaakkonen
Jaakkonen / idle_skilling_cauldron_sim.py
Last active June 9, 2023 23:31
Idle Skilling cauldron optimizer
"""
Simulates the Cauldron in Idle Skilling.
Optimizes for the highest amount of speed and XP per hour.
Each of the 6 cauldrons have 3 equivalent crystal slots which can give following bonuses:
- Green: 2x XP, 2.5x Speed
- Pink: 3x Speed (also to adjacent)
- Orange: 1.2x all crystals
- "x" is an inactive cauldron
@Jaakkonen
Jaakkonen / gist:fb2b96915cead9dd77be79644a14c546
Created April 5, 2023 13:24
AltStore installation with Arch Linux
The default AltStore-Linux anisette server seems to be locked down by Apple. Run your own with `docker run -d -v lib_cache:/opt/lib/ --restart=always -p 6969:6969 --name anise
tte dadoum/anisette-server:latest`. This exposes the login API to 127.0.0.1:6969
Now you can fetch the AltStore ipa with `wget https://cdn.altstore.io/file/altstore/apps/altstore/1_6_2.ipa`.
Get your device UDID (Unique Device Identifier) with `idevicepair list` (provided by libimobiledevice on Arch Linux).
Install AltServer-Linux (found from AUR) and install the AltStore IPA with `ALTSERVER_ANISETTE_SERVER=http://127.0.0.1:6969 altstore -a [APPLE ID] -p [APPLE ID PWD] -u [UID] [IPA FILE]`
Now from settings allow applications signed by your Apple ID to be run and enable developer mode (requires restart).