This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def args_to_dict_accessor(args): | |
code = "" | |
for arg in args: | |
code += f"content['{arg}'], " | |
return code[:-2] | |
def args_to_dict(args): | |
code = "{" | |
for arg in args: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2020-11-25T05:25:32.025Z","extensionVersion":"v3.4.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import system | |
system("""FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --env-filter 'export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"' -f""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release -y | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt update | |
sudo apt-get install docker-ce docker-ce-cli containerd.io -y | |
sudo apt upgrade -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import system | |
from sys import argv | |
if len(argv) > 1: | |
commands = [ | |
f'osascript -e \'quit app "{app_name}"\'' for app_name in argv[1:] | |
] | |
system(';'.join(commands)) | |
else: | |
print("Usage: quit.py <application name>") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from multiprocessing import cpu_count | |
from multiprocessing.dummy import Pool | |
from typing import Any, Callable, Iterable | |
def execute_parallel( | |
func: Callable[..., Any], | |
args: Iterable[tuple[Any, ...]], | |
) -> None: | |
pool = Pool(cpu_count()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[difftool "sourcetree"] | |
cmd = opendiff \"$LOCAL\" \"$REMOTE\" | |
path = | |
[mergetool "sourcetree"] | |
cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" | |
trustExitCode = true | |
[filter "lfs"] | |
clean = git-lfs clean -- %f | |
smudge = git-lfs smudge -- %f | |
process = git-lfs filter-process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import system | |
from time import sleep | |
from sys import argv | |
try: | |
pr_id = argv[1] | |
except: | |
pr_id = '' | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import subprocess | |
import types | |
from enum import Enum | |
from typing import Optional | |
def import_or_install(package: str) -> types.ModuleType: | |
try: |
OlderNewer