Skip to content

Instantly share code, notes, and snippets.

@amoallim15
amoallim15 / main.py
Created November 25, 2025 14:04 — forked from Holi0317/main.py
Temporal workflow with asyncio.Semaphore
import asyncio
from datetime import timedelta
from typing import List
from temporalio import activity, workflow
from temporalio.client import Client
from temporalio.worker import Worker
@activity.defn
@amoallim15
amoallim15 / dre.py
Created July 1, 2024 09:21 — forked from calroc/dre.py
Dirty but functional implementation of Brzozowski’s derivatives of regular expressions.
from itertools import product
phi = frozenset()
y = frozenset({''})
syms = O, l = frozenset({'0'}), frozenset({'1'})
AND, CONS, KSTAR, NOT, OR = 'and cons * not or'.split()
@amoallim15
amoallim15 / write-an-open-source-js-lib.md
Created June 20, 2024 03:06 — forked from oncode/write-an-open-source-js-lib.md
How to Write an Open Source JavaScript Library
@amoallim15
amoallim15 / sqla_pagination.py
Created December 10, 2023 18:29 — forked from siteshen/sqla_pagination.py
SQLAlchemy keyset && offset/limit pagination query mixin
class PaginationMixin(object):
def paginate(self, order_by=None, order_dir=None, limit=None, cursor=None, page=None):
assert not page or not cursor, 'should not combine cusor and page'
# convert arguments
if isinstance(order_by, str):
order_by = getattr(self._primary_entity.expr._identity_class, order_by)
# check arguments
@amoallim15
amoallim15 / Activate Office 2019 for macOS VoL.md
Created July 26, 2020 16:11 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@amoallim15
amoallim15 / README.md
Created June 1, 2020 09:06 — forked from notheotherben/README.md
PEG Grammar for Command Line Parsing

Command Line Parsing Grammar

This grammar allows you to parse command lines for program execution into their various components - specifically: environment variables, the executable itself and any arguments passed to the executable.

It will take an input like the following:

ENV_X=true ENV_Y="yes please" ./test/my_exec arg1 -f1 "arg with spaces" 'another arg' --flag2 yet\ another\ arg --flag=10
@amoallim15
amoallim15 / convertMovToMp4.sh
Created May 20, 2020 06:25 — forked from mrhampson/convertMovToMp4.sh
Convert a mac screencapture .mov to a compressed mp4
#!/bin/bash
usage="$(basename "$0") [-h] [-i] -- program that uses ffmpeg to convert mac screencapture .mov to a compressed mp4 for sharing
where:
-h show this help text
-i (required) the mov file to convert to mp4
dependencies:
Requires ffmpeg to be installed and available in the user's PATH.