Skip to content

Instantly share code, notes, and snippets.

View zeaphoo's full-sized avatar
🎯
Focusing

zhuowei zeaphoo

🎯
Focusing
  • highorder.xyz
  • BeiJing
View GitHub Profile
@zeaphoo
zeaphoo / adt.py
Created September 1, 2022 00:56 — forked from aarondewindt/adt.py
Experimental Algebraic Data Types implementation in Python 3.10
from dataclasses import dataclass
class ADTMeta(type):
def __new__(mcs, name, bases, namespace: dict):
adtc_class = super().__new__(mcs, name, bases, namespace)
if "__is_adt_variant__" in namespace:
if namespace["__is_adt_variant__"]:
return adtc_class

Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

Install Java 8

sudo apt install openjdk-8-jdk-headless

Android SDK

@zeaphoo
zeaphoo / metaver_model.py
Last active January 31, 2020 12:21
add opt lock and dirty state to tortoise-orm model
"""
This example showcases postgres features
"""
from tortoise import Tortoise, fields, run_async
from tortoise.models import Model
from tortoise.backends.asyncpg.executor import AsyncpgExecutor
from tortoise.backends.asyncpg.client import AsyncpgDBClient
import logging
import copy
@zeaphoo
zeaphoo / azadduser.js
Created November 20, 2019 02:29
Batch add users in enterprise application in azure active directory
var names = ["[email protected]"]
function add_user(email) {
//replace id with your element id, it changes every time opened.
var element = document.getElementById("azc-form-guid-b7296a20-57fa-4592-bc1c-f15001a5c063-for");
var ev = new Event('input', { bubbles: true});
ev.simulated = true;
element.value = email;
element.dispatchEvent(ev);