Giter VIP home page Giter VIP logo

dev-assist-command's Introduction

dev-assist-command

Some scripts to assist development

English/简体中文

Requirements

  • Python/Python3 installed, some scripts may need to be executed in a Python environment
~  python3 // Check if Python is installed
Python 3.9.6 (default, Aug 11 2023, 19:44:49) 
[Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
  • Correctly configured adb path in the environment variables, some tasks may need to be executed in an adb environment
~  adb // Check if adb is installed
Android Debug Bridge version 1.0.41
Version 34.0.4-10411341
Installed as ~/Library/Android/sdk/platform-tools/adb
Running on Darwin 22.6.0 (arm64)

Usage

  • Run py scripts
python/python3 xxx.py -h
  • Run shell scripts
chmod +x xxx.sh // Grant execution permissions to the sh script
./xxx.sh <param>

Command Wrapper

To more conveniently run functions directly after starting the terminal, you can create a cmd-wrapper.sh, define the script references and calling methods in it, and initialize it in .zprofile:

Create cmd-wrapper.sh and add the following content

#!/bin/bash

fun cap(){
    python/python3 ~/code/dev-assist-command/screenshot.py "$@"
}

Append in .zprofile file (located at ~/.zprofile)

# cmd-wrapper utils
source <path>/cmd-wrapper.sh

After restarting the terminal, you can directly run the script

~ cap -h
usage: screenshot.py [-h] [-n prefix] [-s scale_factor] [-c] [-o output_dir]

Capture a screenshot.

options:
  -h, --help            show this help message and exit
  -n prefix, --name prefix
                        the prefix of the filename
  -s scale_factor, --scale scale_factor
                        scale of the screenshot
  -c, --copy            copy the screenshot to clipboard
  -o output_dir, --out output_dir
                        the output directory of the screenshot

dev-assist-command's People

Contributors

realskyrin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.