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
"""Utilities for working with iCalendar (ICS) data.""" | |
import logging | |
import os | |
from datetime import datetime, timedelta | |
from zoneinfo import ZoneInfo | |
from icalendar import Calendar | |
logging.basicConfig(level=logging.DEBUG) |
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 python | |
import logging | |
import time | |
from functools import wraps | |
from typing import Any, Callable | |
def log_execution_time(func: Callable[..., Any]) -> Callable[..., Any]: | |
@wraps(func) |
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 python | |
import logging | |
from typing import Optional | |
import boto3 | |
from pydantic import BaseModel, model_validator | |
from typing_extensions import Self | |
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 python | |
import signal | |
import time | |
import pyautogui | |
def press_esc_repeatedly(waiting_sec=300, pressed_key='esc'): | |
signal.signal(signal.SIGINT, signal.SIG_DFL) |
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 python | |
import argparse | |
import bz2 | |
import gzip | |
import logging | |
import os | |
from pathlib import Path | |
from pprint import pformat |
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 python | |
import bz2 | |
import gzip | |
from Bio import SeqIO | |
def read_fasta(path): | |
if path.endswith('.gz'): |
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 bash | |
# | |
# Usage: ./git_rewind_days.sh <int> | |
set -eux | |
DAYS_TO_REWIND="${1}" | |
COMMIT_DATE=$(git log -1 | sed -ne 's/^Date: \+//p') | |
REWIDED_DATE=$(date -d "${COMMIT_DATE% *} - ${DAYS_TO_REWIND} days" | awk '{print $1" "$2" "$3" "$4" "$6}')" ${COMMIT_DATE##* }" |
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 bash | |
# | |
# https://github.com/dceoy/ansible-dev/blob/master/roles/ruby/files/install_rbenv.sh | |
set -uex | |
RBENV_DIR="${HOME}/.rbenv" | |
RB_BUILD_DIR="${HOME}/.rbenv/plugins/ruby-build" | |
RBENV="${RBENV_DIR}/bin/rbenv" | |
[[ ${#} -ge 1 ]] && RB_MAJOR_VER="${1}" || RB_MAJOR_VER=2 |
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 bash | |
# | |
# https://github.com/dceoy/ansible-dev/blob/master/roles/python/files/install_pyenv.sh | |
set -uex | |
PYENV_DIR="${HOME}/.pyenv" | |
PYENV="${PYENV_DIR}/bin/pyenv" | |
[[ ${#} -ge 1 ]] && PY_MAJOR_VER="${1}" || PY_MAJOR_VER=3 |
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 bash | |
# | |
# Usage: ./install_bio_stack.sh <dest dir path> | |
set -uex | |
PREFIX_DIR=$(realpath "${1}") | |
BIN_DIR="${PREFIX_DIR}/bin" | |
SRC_DIR="${PREFIX_DIR}/src" | |
mkdir -p "${SRC_DIR}" "${BIN_DIR}" |
NewerOlder