Skip to content

Instantly share code, notes, and snippets.

@pcchin
pcchin / github-to-gitea.py
Created May 1, 2021 15:23
A simple Python script to migrate your GitHub organisations to Gitea.
import requests
GITHUB_SRC_ORG = "ORGANISATION NAME ON GITHUB"
GITHUB_USERNAME = "YOUR GITHUB USERNAME"
GITHUB_TOKEN = "YOUR GITHUB PERSONAL ACCESS TOKEN"
GITEA_API_TOKEN = "YOUR GITEA PERSONAL ACCESS TOKEN"
GITEA_URL = "https://try.gitea.io"
GITEA_TARGET_ORG = "ORGANISATION NAME ON GITEA"
IS_PRIVATE = True
@pcchin
pcchin / am3_add_distance.py
Last active July 30, 2019 01:04
A simple Python program designed to calculate the distance between your hub airport and the destination airport and outputs them into the existing demand Excel file from am3.info. Openpyxl is required and you can use -h to see all the possible modifiers.
# -*- coding: utf-8 -*-
import argparse
import traceback
import math
from openpyxl import load_workbook
A_UPPERCASE = ord('A')
ALPHABET_SIZE = 26