Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
# Make by x:@BoxMrChen and windsurf ai
import asyncio
import base64
import json
import io
import os
import sys
import pyaudio
@junmei
junmei / README.md
Last active September 15, 2021 08:29 — forked from dberstein/README.md
Git commit hook that prepends message with Jira issue(s) found in branch name (PR branch) otherwise requires message contains at least one Jira issue

With this commit-msg git hook and your branch names have Jira reference(s), your commit messages will be automatically updated to include any missing reference(s) too.

Installation

NOTE: For newer git version than 1.20, git hooks path can be get from: git rev-parse --git-path hooks

Place contents of this gist's commit-msg file into your checkout's .git/hooks/commit-msg file and make it executable.

Bash

For git version > 2.10

@junmei
junmei / vim_cheatsheet.md
Created February 18, 2021 19:27 — forked from awidegreen/vim_cheatsheet.md
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@junmei
junmei / Python_Import_Other_Directories.md
Created January 31, 2021 22:03 — forked from MRobertEvers/Python_Import_Other_Directories.md
Import Python Files From Another Directory Python 3

Import Python Files From Another Directory

I've come across various ways to include files from other directories in python. At this time, none of my python projects have ever scaled enough to warrant a nice directory structure but I find this information useful to know.

Module Search

The Python Docs 6.1.4 explain nicely what happens when you try to import a module.

When a module named spam is imported, the interpreter first searches for a built-in module with that name. If not found, it then searches for a file named spam.py in a list of directories given by the variable sys.path. sys.path is initialized from these locations:
- The directory containing the input script (or the current directory when no file is specified).
- PYTHONPATH (a list of directory names, with the same syntax as the shell variable PATH).
  • The installation-dependent default.