Type | Convention | Information |
---|---|---|
Files | snake_case |
score_label.gd |
Classes | PascalCase |
CharacterBody3D |
Nodes | PascalCase |
ScoreLabel |
Functions | snake_case |
Node.queue_free() |
Variables | snake_case |
Node3D.global_position |
Signals | snake_case |
Node3D.visibility_changed() |
This file contains 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
#!/usr/bin/env bash | |
set -euo pipefail | |
function error_ln() { | |
printf "\033[1;32;31m%s\n\033[m" "${1}" | |
} | |
while IFS='' read -r line; do files+=("${line}"); done < <(git diff-index --cached --name-only HEAD --diff-filter=ACM) | |
for file in "${files[@]}"; do |
This file contains 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
#!/usr/bin/env bash | |
set -euo pipefail | |
# usage: bash docker-run.sh [OPTIONS] IMAGE [COMMAND] [ARG...] | |
function get_valid_port() { | |
local random_port | |
random_port="$((RANDOM % (49151 - 1024 + 1) + 1024))" | |
if [ -n "$(command -v netstat)" ]; then |
I have an Ubuntu system that uses two wired networks simultaneously (PCI Ethernet, USB Ethernet). I would like it to use the USB wired network for internet access and the PCI wired network for accessing the internal network (e.g., 10.0.13.120
, 10.0.13.134
, 10.0.12.1
, 10.0.10.16
, 10.0.10.17
, etc).
1.
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.100.1 0.0.0.0 UG 101 0 0 usb0
0.0.0.0 192.168.31.1 0.0.0.0 UG 102 0 0 enp4s0
This file contains 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
/* | |
* @author duruyao | |
* @date 2023-03-14 | |
* @desc save files to and load files from protobuf messages | |
* @usage EXECUTABLE <SRC_FILENAME> <DST_FILENAME> | |
*/ | |
#include <cstdio> | |
#include <string> |
This file contains 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 sys | |
def have_wining_strategy(*bags: int) -> bool: | |
if 0 == sum(bags): | |
return False | |
for i in range(len(bags)): | |
for n in range(bags[i]): | |
if not have_wining_strategy(*bags[:i], n, *bags[i + 1:]): | |
return True |
This file contains 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
#!/usr/bin/env python3 | |
from typing import Union, Optional, Dict | |
def multiply(arg1: Union[int, float, str, None] = 0.0, | |
arg2: Union[int, float, str, None] = 0.0) -> Optional[Dict[str, Union[int, float, str]]]: | |
""" | |
Calculate the product of two numbers. | |
:param arg1: a factor (default: 0.0) |
This file contains 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
#!/usr/bin/env bash | |
## date: 2022-10-13 | |
## author: [email protected] | |
## file: docker-checker.sh | |
## desc: check path permissions before starting the docker image | |
set -euo pipefail | |
function error_ln() { |
This file contains 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
#!/usr/bin/env python3.9 | |
import os | |
import re | |
import sys | |
import glob | |
from distutils.core import setup | |
from distutils.extension import Extension | |
from Cython.Distutils import build_ext |
NewerOlder