pip install psutil
./safe_run.py bash long_script.sh
| # author: codeskyblue 2025 | |
| # https://github.com/openatx/uiautomator2 | |
| # Example: how to manually handle popup-windows | |
| import random | |
| import time | |
| from typing import Optional, Sequence, Tuple | |
| import adbutils | |
| from loguru import logger |
| #!/usr/bin/env python3 | |
| # coding: utf-8 | |
| # | |
| """ | |
| Refs: | |
| - https://jinja.palletsprojects.com/en/3.1.x/templates/ | |
| - https://stackoverflow.com/questions/39288706/jinja2-load-template-from-string-typeerror-no-loader-for-this-environment-spec | |
| 改进型的yaml,支持符号~,增加默认配置redirect_stderr,stopasgroup,killasgroup,directory,user,stdout_logfile_backups=1,environment增加PATH |
| const puppeteer = require('puppeteer'); | |
| const resolve = require("path").resolve; | |
| // node html2image.js -i input.html -o output.png | |
| (async () => { | |
| var program = require("commander"); | |
| program | |
| .version("0.1.0") | |
| .option("-i, --input <path>", "input html") |
| package main | |
| import ( | |
| "encoding/base64" | |
| "flag" | |
| "fmt" | |
| "io" | |
| "net" | |
| "net/http" | |
| "strings" |
| # coding: utf-8 | |
| # | |
| from PIL import Image, ImageDraw | |
| class Notch(object): | |
| def __init__(self, d): | |
| self.d = d | |
| self.brand = self.d.device_info['brand'] | |
| self.model = self.d.device_info['model'] |
| [[0 1 2 3 4 5 6] | |
| [1 2 3 4 5 6 7] | |
| [2 3 2 4 6 7 8] | |
| [3 4 3 2 4 6 8] | |
| [4 5 4 3 2 4 6] | |
| [5 6 5 4 3 5 7] | |
| [6 7 6 5 4 6 5] | |
| [7 8 7 6 5 7 6]] | |
| [[1 1 1 1 1 1 1] | |
| [0 0 0 0 0 0 0] |
| package main | |
| import ( | |
| "log" | |
| "net/http" | |
| "sync" | |
| "github.com/gorilla/websocket" | |
| ) |
| package com.example.hzsunshx.helloworld; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.support.test.InstrumentationRegistry; | |
| import android.support.test.uiautomator.By; | |
| import android.support.test.uiautomator.UiDevice; | |
| import android.support.test.uiautomator.UiObject; | |
| import android.support.test.uiautomator.UiObject2; | |
| import android.support.test.uiautomator.Until; |
| /build |