Skip to content

Instantly share code, notes, and snippets.

View kacper-serewis's full-sized avatar

Kacper Serewiś kacper-serewis

View GitHub Profile
@kacper-serewis
kacper-serewis / ics-dashboard-button.js
Created August 24, 2025 11:06
Extract icscards.nl card statements to JSON using TamperMonkey
// ==UserScript==
// @name ICS Dashboard Button
// @namespace http://tampermonkey.net/
// @version 2025-08-24
// @description Export as JSON
// @author You
// @match https://www.icscards.nl/web/consumer/dashboard
// @icon https://www.google.com/s2/favicons?sz=64&domain=icscards.nl
// @grant none
// ==/UserScript==
#!/usr/bin/env bash
#
# ignore-gitignored.sh — apply xattr ignore to every git-ignored directory
# — with optional dry-run mode
#
# Usage: ./ignore-gitignored.sh [-n|--dry-run] [root_dir]
# -n, --dry-run Show what would be ignored without touching anything
# root_dir Directory under which to scan for Git repos (defaults to CWD)
#
@kacper-serewis
kacper-serewis / howto.md
Created June 10, 2024 21:35
How to install brew from different branch

How to install brew from different (work in progress) branch

When new macOS releases, there is a chance that brew will be broken. But there is also a chance that brew developers are already working on support for the new macOS version. To try the newest brew version without waiting for it to get into the stable branch you can do the following:

In this example, use feature branch for macOS 15 support

cd `brew --cellar`
git checkout macos-15
@kacper-serewis
kacper-serewis / timeular-widget.js
Created November 18, 2023 23:23
Scriptable widget which shows how much you will get on your payday using Timeular.
const CONFIG = {
url: "https://api.timeular.com/api/v3/",
token: "",
loanPerHour: 69,
ignoreActivities: ["817556"], // Like Break activity
plannedActivities: ["1463431"], // Like personal activity used for planning (not visible by employer)
};
const units = {
year: 24 * 60 * 60 * 1000 * 365,
month: (24 * 60 * 60 * 1000 * 365) / 12,
@kacper-serewis
kacper-serewis / ns_factuur_extract.py
Created November 13, 2023 22:14
This script converts pdf "factuur" from https://www.ns.nl/mijnns#/betaaloverzicht to JSON array with date, transporter, discount, from, to and price. Hacky, but it works. Station parsing needs to be done better.
import pytesseract # type: ignore
from PIL import Image # type: ignore
from time import sleep
import re
import fitz # type: ignore
import json
import glob
for p in glob.glob("*.pdf"):
pdf_file = fitz.open(p)
@kacper-serewis
kacper-serewis / hass-widget.js
Created October 24, 2023 21:17
Scriptable Home Assistant widget which shows entity state
// Scriptable HomeAssistant Widget
const hassUrl = "https://.....com";
const hassToken =
"eyJhbGciOi....";
const sensors = {
"sensor.ewelink_th01_woonkamer_temperature_2": "Woonkamer",
"sensor.ewelink_th01_kacper_temperature_2": "Kacper",
};
<?xml version="1.0" encoding="UTF-8"?>
<Response></Response>
#!/bin/bash
NODE_EXPORTER_VERSION="1.6.1"
NODE_EXPORTER_USER="node_exporter"
BIN_DIRECTORY="/usr/local/bin"
# Create user if not exists
id -u ${NODE_EXPORTER_USER} &>/dev/null || useradd --no-create-home --shell /bin/false ${NODE_EXPORTER_USER}
# Check if successful

Keybase proof

I hereby claim:

  • I am k4czp3r on github.
  • I am kserewis (https://keybase.io/kserewis) on keybase.
  • I have a public key ASCeZRaAk1Kj0QPcu3ePgrCpmQXvnbCCXc4QDAeHueP6TQo

To claim this, I am signing this object:

@kacper-serewis
kacper-serewis / main.ino
Created September 4, 2019 07:57
fontys_tech_challenge_5_1_1.ino
int count = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
count += 1;
Serial.println(count);
delay(1000);