Skip to content

Instantly share code, notes, and snippets.

View ErikKalkoken's full-sized avatar

Erik Kalkoken ErikKalkoken

View GitHub Profile
@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() {
@ErikKalkoken
ErikKalkoken / pypi_deploy_github.md
Last active January 25, 2022 13:30
Adding pypi deploy to github

How to add PyPI deployment to GitLab

  • Create the initial project on PyPI manually via twine
  • Create an API token for PyPI with it's scope limited to the project
  • Add the API token to the GitLab project under CI/CD - Variables:
    • TWINE_USERNAME = __token__
    • TWINE_PASSWORD = The API Token. Starts with pypi-
  • Set the variables as "Masked" to prevent them from showing up in log files
  • Add a deploy section to your .gitlab.ci.yaml
  • To execute add a new tag to your commit
@ErikKalkoken
ErikKalkoken / aa-dev-setup-wsl-vsc-v2.md
Last active November 30, 2021 09:18
Guide on how to setup an Alliance Auth development environment on Windows 10 with WSL and Visual Studio Code

How to setup AA development on Windows 10 with WSL and Visual Studio Code

Important:
This version is outdated and no longer maintained. Your find the current version in the Alliance Auth documentation: Direct Link

This docunent describes step-by-step how to setup a complete development environment for Alliance Auth apps on Windows 10 with Windows Subsystem for Linux (WSL) and Visual Studio Code.

The main benefit of this setup is that it runs all services and code in the native Linux environment (WSL) and at the same time can be full controlled from within a comfortale Windows IDE (Visual Studio Code) including code debugging.

In addition all tools described in this guide are open source or free software.