Skip to content

Instantly share code, notes, and snippets.

View ErikKalkoken's full-sized avatar

Erik Kalkoken ErikKalkoken

View GitHub Profile
@ErikKalkoken
ErikKalkoken / supported_chars
Created October 16, 2018 13:53
Checks if all characters of a given string are supported by OTF / TTF font Outputs the findings in a simple HTML table
<?php
/**
* Checks if all characters of a given string are supported by OTF file
* Outputs the findings in a simple HTML table
*
* Needs: php-font-lib @ https://github.com/PhenX/php-font-lib
*/
require_once "../src/FontLib/Autoloader.php";
@ErikKalkoken
ErikKalkoken / supported_chars.php
Last active October 12, 2022 10:17
Simple script that checks if all characters of a given string are supported by OTF / TTF font and outputs the findings in a simple HTML table.
<?php
/**
* Checks if all characters of a given string are supported by OTF file
* Outputs the findings in a simple HTML table
*
* Needs: php-font-lib @ https://github.com/PhenX/php-font-lib
*/
require_once "../src/FontLib/Autoloader.php";
@ErikKalkoken
ErikKalkoken / SlackOauthService.cs
Last active November 20, 2018 15:05
// This is a basic HTTP service for creating new Oauth tokens for Slack apps in .NET Core
// This is a basic HTTP service for creating new Oauth tokens for Slack apps in .NET Core
using System;
using System.Net;
using System.Threading;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Collections.Specialized;
@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;
@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 / 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-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 / 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 / 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 / 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