Skip to content

Instantly share code, notes, and snippets.

@YuyaKobayashi
YuyaKobayashi / chain_iter.py
Last active October 23, 2025 16:29
ChainIter
#!/usr/bin/env python3
import numpy as np
import itertools
import functools
from typing import Any, TypeVar
from collections.abc import Iterator, Callable
T = TypeVar("T")
#!/bin/bash
#### USER CONFIG ####
REMOTE_HOST=
REMOTE_DIR=
#####################
rsync -av ./ ${REMOTE_HOST}:${REMOTE_DIR} \
--exclude deploy.sh \
--exclude .git/ \
@YuyaKobayashi
YuyaKobayashi / pre-push
Last active October 21, 2018 05:39
git hook: pre-push for checking PEP8
#!/bin/bash
# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
#!/bin/bash
fin_err(){
errmsg=$@
if [[ -n "$errmsg" ]]; then
sudo rm -fr $work_dir
fi
echo "$errmsg" >&2
sudo systemctl start jma-receipt