This cheat sheet provides a quick reference for commonly used Git commands when working with submodules.
git submodule add <repository-url> <path>
items = [ | |
{'name': 'C', 'requires': ['E']}, | |
{'name': 'B', 'requires': ['C', 'D']}, | |
{'name': 'E', 'requires': []}, | |
{'name': 'A', 'requires': ['B']}, | |
{'name': 'D', 'requires': []}, | |
] | |
items1 = {'C': ['E'], 'B': ['C', 'D'], 'E': [], 'A': ['B'], 'D': []} |
71 0 RESUME 0 | |
72 2 LOAD_GLOBAL 1 (NULL + len) | |
12 LOAD_FAST 0 (nums) | |
14 CALL 1 | |
22 STORE_FAST 1 (n) | |
73 24 BUILD_LIST 0 | |
26 STORE_FAST 2 (result) |
package main | |
import "fmt" | |
const ( | |
Electronics = uint8(1) << iota // 0000 0001 (1) | |
HomeGoods // 0000 0010 (2) | |
Apparel // 0000 0100 (4) | |
Toys // 0000 1000 (8) | |
Outdoor // 0001 0000 (16) |
#!/bin/bash | |
if (( $# != 1 )); then | |
echo "Error: No Docker container ID provided." | |
exit 1 | |
fi | |
CONTAINER_ID=$1 | |
if ! docker inspect "$CONTAINER_ID" &>/dev/null; then |
Medusa is a versatile command-line tool designed for developers working on API services. It provides functionalities to capture, replay, and test API calls, enhancing your workflow and ensuring the stability and performance of your services.
When developing or maintaining APIs, Medusa allows you to capture API calls and their responses. This feature is particularly useful when fixing bugs or adding new features. By preserving the order of calls, you can analyze and compare results, facilitating regression testing and performance analysis.
import csv | |
class CSVWriter(): | |
""" | |
A context manager for writing formatted data to CSV files. | |
This class handles the creation and writing of data to CSV files. It infers the CSV headers from the first data entry | |
for each table. The CSV files are saved in the specified directory. | |
Attributes: |
import json | |
def new_dn(dn, key): | |
return dn + (key,) | |
def sm_looper(run_func, sm_model): | |
def loop_over(model, dn=()): | |
if "type" not in model: |
func hasPrefixCaseInsensitive(s, prefix string) bool { | |
if len(prefix) > len(s) { | |
return false | |
} | |
return strings.EqualFold(s[:len(prefix)], prefix) | |
} | |
!hasPrefixCaseInsensitive(single, lSearchTerm) | |
func IMatch(s, match string) bool { |