Skip to content

Instantly share code, notes, and snippets.

View ppdms's full-sized avatar
📑
RTFM

Basil Papadimas ppdms

📑
RTFM
  • Informatics, AUEB
  • Athens, Greece
View GitHub Profile
@font-face {
font-family: Inter;
src: url("_Inter.ttc");
}
.card1, .card2 {
text-align: left;
}
.card {
#!/usr/bin/env fish
# Script to properly zip all epub directories into epub files
# Uses the correct epub zipping method with uncompressed mimetype
# https://www.mobileread.com/forums/showthread.php?t=55681
set downloads_dir (pwd)
# Find all .epub directories
for epub_dir in *.epub/
@ppdms
ppdms / init.lua
Created March 22, 2025 20:49
.hammerspoon/init.lua
local ha_token = "" -- Home Assistant API token
local lg_display_name = "LG HDR 4K" -- External monitor name
local internal_display_uuid = "" -- Internal display UUID
local ha_url = "http://X:8123/api/services/light/turn_" -- Home Assistant API base URL
local light_entity = "light.screen" -- Replace with your actual entity ID
local last_state = false -- Track monitor connection
local locked = false -- Track screen lock state
local previous_brightness = 1 -- Default brightness before dimming
local lid_closed = false -- Track if lid is closed
#!/usr/bin/env python3
# THIS SOFTWARE COMES "AS IS", WITH NO WARRANTIES. THIS MEANS NO LIABILITY OR GUARANTEES FOR FUNCTIONALITY OR SAFETY, NEITHER EXPLICIT NOR IMPLIED. USE AT YOUR OWN RISK.
from pypdf import PdfWriter, PdfReader
import os
import argparse
def get_outline(reader, base_page=0):
"""
Recursively extract outline entries with adjusted page numbers
"""
@ppdms
ppdms / list.txt
Created September 20, 2024 12:03
Block instagram profile suggestions with ublock origin
instagram.com##div:has(> div > div > a:has(span:has-text(/^See All$/)))
@ppdms
ppdms / configuration.yml
Created June 15, 2024 17:51
Home Assistant configuration.yml snippet for Adaptive Lighting statistics
adaptive_lighting:
template:
- sensor:
- name: "Sun Position"
unit_of_measurement: "°"
state: "{{ state_attr('switch.adaptive_lighting', 'sun_position') }}"
state_class: measurement
- name: "Adaptive Color Temperature"
@ppdms
ppdms / walküre.sh
Last active May 14, 2024 08:48
Notify Discord with webhook if there's tickets for a GNO performance
#!/bin/bash
######################################################################
# @author : Vasileios Papadimas (papadimas@protonmail.com)
# @file : tickets.sh
# @created : Sunday Mar 24, 2024 20:23:31 EET
######################################################################
output=$(curl -s 'https://www.ticketservices.gr/event/gno-die-walkuere/?lang=el' | iconv -f "windows-1253" -t UTF-8)
.text
.globl _start
_start:
lw $t0, newl
li $t1, 0
main:
li $v0, 12
#include <cmath>
#include <iostream>
#include <ostream>
using std::cout;
using std::endl;
int main(int argc, char *argv[]) {
float x = 1;
while (7 + x != 7) {
@ppdms
ppdms / combinations.s
Created November 21, 2023 10:42
Calculate binomial coefficient in MIPS32 assembly
.text
.globl __start
_start:
la $a0, pn
li $v0, 4
syscall # print prompt for n
la $v0, 5
syscall # read n into $v0