Skip to content

Instantly share code, notes, and snippets.

View Jackenmen's full-sized avatar
👀

Jakub Kuczys Jackenmen

👀
View GitHub Profile
@Jackenmen
Jackenmen / aw_summarize_time_spent.py
Last active October 11, 2023 17:44
ActivityWatch - summarize time spent into CSV file. Requires aw-client library
# Copyright 2023 Jakub Kuczys (https://github.com/Jackenmen)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@Jackenmen
Jackenmen / generate_apk.yaml
Last active June 1, 2023 06:08
A GitHub Actions workflow file for building signed Android APKs
# NOTE: This workflow needs to be adjusted in places marked with '# TODO: ' comments
#
# Use this command to generate a keystore and a key if you don't already have one:
# $ keytool -genkey -v -keystore my-key.p12 -alias my-key -keyalg RSA -keysize 4096 -validity 50000 -keypass android -storepass android
#
# You can use this command to create base64 string of the file for later use in KEYSTORE_BASE64:
# $ base64 my-key.p12 > my-key.p12.base64
name: Build signed Android APK
on:
@Jackenmen
Jackenmen / download_fb_post_images.py
Created October 2, 2022 15:58
Download images from the given Facebook posts
import operator
import requests
API_URL = "https://graph.facebook.com/v15.0/"
TOKEN = ""
PAGE_ID = ""
# {"post_id": "folder name"}
POST_IDS = {}
@Jackenmen
Jackenmen / 0_version_list.csv
Last active August 11, 2022 11:12
Get versions of bundled pip and setuptools in ensurepip. Requires `packaging`. Run in the root of the CPython repository after pulling tags.
Python version pip version setuptools version
3.11.0rc1 22.2.2 63.2.0
3.11.0b5 22.2 63.2.0
3.11.0b4 22.0.4 58.1.0
3.11.0b3 22.0.4 58.1.0
3.11.0b2 22.0.4 58.1.0
3.11.0b1 22.0.4 58.1.0
3.11.0a7 22.0.4 58.1.0
3.11.0a6 21.2.4 58.1.0
3.11.0a5 21.2.4 58.1.0
@Jackenmen
Jackenmen / fix_po_files_from_pre_redgettext_3.3.py
Created July 17, 2022 02:30
A script that fixes po files that were generated by redgettext<3.3. See https://github.com/Cog-Creators/redgettext/issues/1
from pathlib import Path
from typing import Dict
import polib
from lxml import etree
def _str_field(self, *args, **kwargs):
ret = _str_field_orig(self, *args, **kwargs)
if len(ret) > 1:
@Jackenmen
Jackenmen / fetch_ubuntu_repos.py
Last active July 13, 2022 21:54
Little script for fetching metadata from ALL Ubuntu repositories and search for available Python versions.
import gzip
import os
import sys
from io import BytesIO
from pathlib import Path
import requests
from debian import deb822
cwd = Path("processed")
"""A way to get all GH contributors by diffing tags alone, without using release milestone."""
import subprocess
GET_PR_HISTORY_QUERY = """
query getPRHistory(
$owner: String!
$name: String!
$tag_name: String!
$after: String
Package Python 3.10 support
aiohttp ❔ (deprecation warnings, might use removed loop param somewhere)
aiohttp-json-rpc ❔ (deprecation warnings)
aiosqlite ❔ (we don't actually use this, so...)
appdirs ❔ (probably works fine now but we should probably just move to platformlibs instead)
apsw-wheels
async-timeout ❔ (probably works fine now; no indication of that though)
attrs ✔️
Babel ✔️ (officially support will be added in 2.9.2)
@Jackenmen
Jackenmen / get_session_id_and_token.py
Last active August 17, 2021 04:25
Get Revolt Session ID and Token (Python 3.7+)
from __future__ import annotations
import cgi
import json
import logging
import urllib.parse
import urllib.request
import webbrowser
from http.server import BaseHTTPRequestHandler, HTTPServer
from typing import Any
@Jackenmen
Jackenmen / open-discord-message-links-in-desktop-client.user.js
Last active January 29, 2021 00:30
Replace Discord message links with links using discord:// protocol so that the messages open in the desktop client.