Skip to content

Instantly share code, notes, and snippets.

View lepinkainen's full-sized avatar
💭
Hmm?

Riku Lindblad lepinkainen

💭
Hmm?
  • Finland
  • 09:51 (UTC +03:00)
View GitHub Profile
@lepinkainen
lepinkainen / cnc_generals_code_comments.md
Created August 27, 2025 10:51
C&C Generals code comments

Funny Generals Source code comments

Just a compilation of funny code comments and entity names I found while browsing: https://github.com/electronicarts/CnC_Generals_Zero_Hour

// our RNG is basically shit -- horribly nonrandom at the start of the sequence.
// get a few values at random to get rid of the dreck.
// there's no mathematical basis for this, but empirically, it helps a lot.
UnsignedInt silly = GetGameLogicRandomSeed() % 7;

for (Int poo = 0; poo < silly; ++poo)

@lepinkainen
lepinkainen / hn_watch.py
Created August 20, 2025 14:07
HN reply watcher
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.9"
# dependencies = [
# "httpx>=0.27",
# "anyio>=4.4",
# ]
# ///
"""
hn_watch.py — Watch your Hacker News comments for score changes and replies.
@lepinkainen
lepinkainen / autoCover.js
Created August 19, 2025 08:33
Create a colour based on note name
module.exports = async (params) => {
const { app } = params;
const file = app.workspace.getActiveFile();
if (!file) return;
// Only run for Markdown files
if (!file.name.endsWith(".md")) return;
// Read full note text
let content = await app.vault.read(file);
@lepinkainen
lepinkainen / irccloud-to-sqlite.py
Created June 13, 2025 11:28
Create a datasette compatible sqlite3 database from IRCCloud logs, full text search is enabled
import re
import sqlite3
from datetime import datetime, UTC
import argparse
import os
def init_db(db_path, channel, source_file):
conn = sqlite3.connect(db_path)
c = conn.cursor()
@lepinkainen
lepinkainen / finnish-parliament-voting.html
Created April 2, 2025 10:41
A SVG representation of the finnish parliament with the ability to visualise votes per seat
<!DOCTYPE html>
<html>
<head>
<title>Finnish Parliament Seating Chart</title>
<style>
body {
font-family: sans-serif;
display: flex;
flex-direction: column;
align-items: center;
@lepinkainen
lepinkainen / safari_readling_list_to_md.py
Created March 6, 2025 08:30
Export Safari reading list to an Obsidian-flavoured markdown file
import plistlib
import os
from datetime import datetime
# Path to Safari Bookmarks file, copy it locally because macOS doesn't allow direct access
# to the file in the user's Library folder
plist_path = os.path.expanduser("./Bookmarks.plist")
# Read the plist file
try:
@lepinkainen
lepinkainen / imgoptim.go
Last active June 12, 2024 09:41
Grab all png's from defined directory, convert it to jpeg and webp, keep the smallest
package main
import (
"bufio"
"bytes"
"fmt"
"image"
"image/jpeg"
"io/ioutil"
"os"
@lepinkainen
lepinkainen / traefik-docker-compose.yml
Last active February 19, 2021 07:19
Traefik setup
# Traefik compose file
services:
reverse-proxy:
# The official v2.1 Traefik docker image
image: traefik:v2.2.1
container_name: traefik
# Enables the web UI and tells Traefik to listen to docker
command:
- --log.level=INFO
@lepinkainen
lepinkainen / Caddyfile
Last active February 19, 2020 22:41
Traefik + Caddy + ACME + services + fancy subdomains
0.0.0.0:80 {
tls off
status 404 /
}

Sotakarjujen houserulet

Errata

Ryhmänjohtaja

  • Ryhmänjohtaja saa kierroksen alussa ilmaisen komentoactionin koko ryhmälle
  • Kolme komentoa: a) “hyökkää X:ää vastaan” b) “parempaan ilmasuojaan”