This file contains hidden or 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
# coding=utf-8 | |
class Singleton(object): | |
def __new__(cls): | |
if not hasattr(cls, "instance"): | |
cls.instance = super(Singleton, cls).__new__(cls) | |
return cls.instance |
This file contains hidden or 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 python3 | |
import argparse | |
from glob import glob | |
from typing import List, Tuple, Union, Iterable, Optional | |
from pathlib import Path | |
from itertools import combinations | |
from dataclasses import dataclass |
This file contains hidden or 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
#!/bin/bash | |
# Intended usage: | |
# - You run a super long script with fancy tqdm progress bars in a remote server as usual: | |
# | |
# nohup python super_long_script.py > super_long.log & | |
# # monitor as long as you want | |
# tail -f super_long.log |
This file contains hidden or 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
#!/bin/bash | |
# If a requirements.txt file is supplied, it will be updated with the latest versions of each package. | |
# If a pyproject.toml is required, package upgrades will just be printed. | |
echo "Careful:" >&2 | |
echo " - Virtual Env is required" >&2 | |
echo " - If any of your PYPY packages contain the strin 'http', it is possible that it gets astray, manually inspect it" >&2 | |
def_deps_key="dependencies" |
This file contains hidden or 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
#/bin/bash | |
# Install: | |
# - zsh (requires sudo) | |
# - oh-my-zsh | |
# - zsh-autosuggestions plugin | |
# - conda-zsh-completion plugin | |
# - custom themes | |
# - custom zshrc and styles |
This file contains hidden or 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
#!/bin/python3 | |
import sys | |
import json | |
data = sys.stdin.readlines() | |
args = [] | |
for line in data: | |
line = line.replace("\\", "").strip().split(" ") | |
args.extend(line) |
OlderNewer