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
# Based on https://github.com/canonical/multipass-blueprints/blob/ae90147b811a79eaf4508f4776390141e0195fe7/v1/docker.yaml | |
apt: | |
sources: | |
docker: | |
source: | | |
deb https://download.docker.com/linux/ubuntu $RELEASE stable | |
key: | | |
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mQINBFit2ioBEADhWpZ8/wvZ6hUTiXOwQHXMAlaFHcPH9hAtr4F1y2+OYdbtMuth |
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
import asyncio | |
from udp import DatagramReader, DatagramWriter, create_udp_client | |
async def listen_forever(writer: DatagramWriter, reader: DatagramReader) -> None: | |
while not writer.is_closing(): | |
data = await reader.recv(2048) | |
print("Received:", data.decode()) |
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 func(): | |
print("Success!!") |
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
#! /bin/bash | |
if [ "$1" = "upgrade" ]; then | |
echo "updating..." | |
docker pull colorfulboard/bq_profile:latest --quiet > /dev/null | |
echo "done" | |
elif [ "$1" = "local" ]; then | |
docker run -it --rm -v ~/.config/gcloud:/root/.config/gcloud -v $(pwd):/usr/src/app colorfulboard/bq_profile:latest "${@:2:($#-1)}" | |
else | |
docker run -it --rm -v $(pwd):/usr/src/app colorfulboard/bq_profile:latest "$@" |
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
# 下記を参考にして作成したtextlint | |
# https://efcl.info/2015/09/10/introduce-textlint/ | |
# docker run -it --rm -v $(pwd):/tmp -w /tmp textlint:0.1 *.md | |
FROM node:8-jessie | |
RUN npm i -g textlint | |
RUN npm i -g textlint-rule-max-ten textlint-rule-spellcheck-tech-word textlint-rule-no-mix-dearu-desumasu | |
ENTRYPOINT ["textlint", "--rule", "no-mix-dearu-desumasu", "--rule", "max-ten", "--rule", "spellcheck-tech-word"] |
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
import sys | |
import unicodedata | |
MAX_LENGTH = 60 | |
CHECK_ONLY_OUTPUT = False | |
def check_line(line): | |
if line.startswith('#'): | |
print(line, end='') |
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
""" | |
# 下記を実行するとコードブロックからdoctestファイル ham_doctest.py、egg_doctest.py を作成する | |
$ python3 create_doctestfile.py ham.md egg.md | |
# doctestは下記で実行可能 | |
$ python3 ham_doctest.py | |
""" | |
import sys | |
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
""" | |
$ python3 check.py xxx.md yyy.md | |
Markdownのコードブロック内の各行の長さがMAX_LENGTHを超えている場合のみその行を出力する | |
""" | |
import sys | |
import unicodedata | |
MAX_LENGTH = 60 | |
CHECK_ONLY_OUTPUT = False |
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 python:3.7 | |
WORKDIR /usr/src/app | |
RUN pip install psutil memory-profiler | |
COPY . . | |
RUN ./mkdummy.sh | |
ENTRYPOINT ["python", "-m", "memory_profiler", "copy_file.py"] |
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
""" | |
Cloud Function: DeleteInstance | |
google-api-python-client==1.7.8 | |
Environment Variable | |
AUTO_TOKEN: a value which is set in Stackdriver Notification WebHook | |
""" | |
import json | |
import os |
NewerOlder