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
version: '3' | |
tasks: | |
migrate-up: | |
dir: "{{.TASKFILE_DIR}}/" | |
cmds: | |
- docker run -v ./migrations:/migrations --user $(id -u):$(id -g) --network host migrate/migrate -path /migrations -database ${DATABASE_URL} up | |
description: "Apply all up migrations" | |
migrate-down: | |
dir: "{{.TASKFILE_DIR}}/" |
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
class SignalHandler { | |
public: | |
using Handler = std::function<void(int)>; | |
SignalHandler(const SignalHandler &) = delete; | |
SignalHandler &operator=(const SignalHandler) = delete; | |
static void process(int sig) | |
{ | |
for (const auto &f : handler().handlers_) |
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 | |
set -ex; | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
cd ${DIR} | |
SLNNAME=${PWD##*/} | |
APPNAME=src/${SLNNAME}App | |
LIBNAME=src/${SLNNAME}Lib | |
TESTNAME=test/${SLNNAME}.Tests |
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
# |
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
import asyncio | |
import functools | |
import signal | |
async def my_task(task_num): | |
try: | |
while True: | |
print(f'Task {task_num}') | |
await asyncio.sleep(task_num + 1) |