Skip to content

Instantly share code, notes, and snippets.

View lsk567's full-sized avatar
๐Ÿ‘‹

Shaokai (Jerry) Lin lsk567

๐Ÿ‘‹
View GitHub Profile
import os
import time
import shutil
import subprocess
import signal
import sys
import argparse
#If the applescript stops working or you don't want the function, set enableapplescript to False
enableapplescript = True
@paniq
paniq / minmaxabssign.txt
Last active November 8, 2024 13:39
useful min/max/abs/sign identities
max(-x,-y) = -min(x,y)
min(-x,-y) = -max(x,y)
abs(x) = abs(-x)
abs(x) = max(x,-x) = -min(x,-x)
abs(x*a) = if (a >= 0) abs(x)*a
(a < 0) -abs(x)*a
// basically any commutative operation
min(x,y) + max(x,y) = x + y