Skip to content

Instantly share code, notes, and snippets.

View ErikKalkoken's full-sized avatar

Erik Kalkoken ErikKalkoken

View GitHub Profile
@ErikKalkoken
ErikKalkoken / migrate-to-bs5.md
Last active April 18, 2025 15:30
Checklist: AA app migration to BS5 templates

Checklist: AA app migration to BS5 templates

Checklist for migrating an AA app to BS5 / AA4 style.

Migrate templates

Base template (base.py)

Switch to new AA base by replacing {% extends 'allianceauth/base.html' %} with

@ErikKalkoken
ErikKalkoken / main.go
Created February 3, 2025 03:45
Convert a JPEG image into an "avatar style" circle image
package main
import (
"bufio"
"image"
"image/color"
"image/draw"
_ "image/jpeg"
"image/png"
"os"
@ErikKalkoken
ErikKalkoken / find_appy.py
Created October 4, 2024 13:37
Find_apps is a command line tool to identify Django apps in a Python package
"""Find_apps is a command line tool to identify all Django apps in a Python package.
The tools will look for and parse AppConfig definitions in apps.py files.
Django apps which do not have an apps.py file will not be recognized.
usage: find_apps.py [-h] [-path PATH] [-hide-name]
options:
-h, --help show this help message and exit
-path PATH, -p PATH starting path (default: .)
@ErikKalkoken
ErikKalkoken / example.go
Created September 26, 2024 17:14
Example for using a named mutex with github.com/juju/mutex
package main
import (
"errors"
"log"
"os"
"os/signal"
"syscall"
"time"
@ErikKalkoken
ErikKalkoken / build_appimage.sh
Created September 10, 2024 13:03
This is bash script for building an AppImage with AppStream metadata from a Fyne app
#!/usr/bin/env bash
# This script builds an AppImage with AppStream metadata from a Fyne app
set -e
# Parameters
metadir="."
# Constants
@ErikKalkoken
ErikKalkoken / statictable.go
Last active May 7, 2024 12:02
StaticTable is a modification of Fyne's table widget, which does not allow the user to select or hover.
package widgets
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/widget"
)
// StaticTable is a modification of Fyne's table widget, which does not allow the user to select or hover.
// It is useful for displaying data in a table format, when the user is not supposed to interact with it.
type StaticTable struct {
@ErikKalkoken
ErikKalkoken / convert_iphone_to_standard_notes.md
Created June 14, 2023 19:30
How to import iphone notes into Standard Notes

How to import iphone notes into Standard Notes

This guide explains how one can import notes from the iPhones notes app into Standard Notes using free and open source software only.

Note that this process will import notes as plain text only.

  1. Create a backup of your iPhone

  2. Extract the notes database from that backup using iTunes Backup Explorer -> NoteStore.sqlite

@ErikKalkoken
ErikKalkoken / convert_notes.py
Created June 14, 2023 19:28
Convert iphone notes from JSON format into plain text files.
"""Convert iphone notes from JSON format into plain text files."""
import argparse
import datetime as dt
import json
import os
import re
from pathlib import Path
from typing import NamedTuple
@ErikKalkoken
ErikKalkoken / rtd_dark.css
Created June 15, 2022 12:12
Dark mode for Sphinx ReadTheDocs theme
/*!
* @name Readthedocs
* @namespace http://userstyles.org
* @description Styles the documentation pages hosted on Readthedocs.io
* @author Anthony Post
* @homepage https://userstyles.org/styles/142968
* @version 0.20170529055029
*
* Modified by Aloïs Dreyfus: 20200527-1037
* Modified by Erik Kalkoken: 20220615
@ErikKalkoken
ErikKalkoken / esi_status.go
Last active March 21, 2022 17:51
GoESI Example 1
package main
import (
"context"
"fmt"
"github.com/antihax/goesi"
)
func main() {