Skip to content

Instantly share code, notes, and snippets.

View ErikKalkoken's full-sized avatar

Erik Kalkoken ErikKalkoken

View GitHub Profile
@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.

@ErikKalkoken
ErikKalkoken / get_privat_slack_file.py
Last active June 12, 2023 12:15
Fetch a private file from Slack
# fetching a private Slack file with requests
import requests
import os
slack_token = os.environ['SLACK_TOKEN']
url = 'https://files.slack.com/files-pri/T12345678-F12345678/my_file.jpg'
res = requests.get(url, headers={'Authorization': f'Bearer {slack_token}'})
res.raise_for_status()
@ErikKalkoken
ErikKalkoken / aa-dev-setup-windows.md
Last active February 8, 2020 12:27
This is a guide about setting up a dev environment for Alliance Auth on Windows 10

Alliance Auth: Setting up a dev environment on Windows

One of the big advantages of Alliance Auth (AA) is that can be easily extended with custom apps. So with a little Python and Django know-how you can quickly add your own apps to AA's web portal and make use of AA's permission system.

To help you get up to speed quickly here is how you can setup a dev environment on Windows.

Limitations

This guide is for Windows, because some devs will find it more comfortable to develop in a Windows environment. However, AA does not officially support Windows, so this approach comes with some limitations. Please also see our other guide based on WSL for Winddows 10, which does not hav any of these limitations.

@ErikKalkoken
ErikKalkoken / dialog.gs
Created August 6, 2019 15:05
Slack Dialog with Google Apps Script
var SLACK_ACCESS_TOKEN = PropertiesService.getScriptProperties().getProperty('SLACK_ACCESS_TOKEN');
function doGet(e) {
return ContentService.createTextOutput("I am alive");
}
function doPost(e) {
var params = e.parameter;
var token = params.token;
var text = params.text;