run_name = f"{tag_name}-{datetime.now().strftime('%Y-%m-%d-%H-%M-%S-%f')}"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| from nicegui import events, ui | |
| def mouse_handler(e: events.MouseEventArguments): | |
| color = "SkyBlue" if e.type == "mousedown" else "SteelBlue" | |
| ii.content += f'<circle cx="{e.image_x}" cy="{e.image_y}" r="15" fill="none" stroke="{color}" stroke-width="4" />' | |
| ui.notify(f"{e.type} at ({e.image_x:.1f}, {e.image_y:.1f})") | |
| src = "https://picsum.photos/id/565/640/360" |
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 numpy as np | |
| from pathlib import Path | |
| names = [ | |
| str(p).replace("/", "-").replace("\\", "-").replace("C:-", "").lower().strip("-") | |
| for p in Path("/mnt/c/Windows").glob("*/*") | |
| if len(str(p)) < 40 | |
| ] |
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
| # setup FIFO and hang python interpreter | |
| fifo_path=$TMPDIR/"pysh-"$(date +%s) | |
| mkfifo $fifo_path | |
| python3 <$fifo_path & | |
| exec 3>$fifo_path | |
| # perform some commands | |
| echo 'import os' >$fifo_path | |
| cat >$fifo_path <<EOF | |
| import json |
The idea is to use this along with -v $PWD:/app option.
Whenever you use this workflow all files created in your
working directory will be created by the docker user (e.g. root)
requiring you to use sudo for clean-up...
... random sudo rm -rf something is just what you need in your life.
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
| from __future__ import annotations | |
| from flask import Flask | |
| from flask import request | |
| from flask import abort | |
| from multiprocessing import Process | |
| import subprocess as sp | |
| import sys | |
| import os | |
| import json |
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
| from __future__ import annotations | |
| from flask import Flask | |
| from flask import request | |
| from flask import abort | |
| from multiprocessing import Process | |
| import subprocess as sp | |
| import sys | |
| import os | |
| from dataclasses import dataclass, field |
NewerOlder
