This file contains hidden or 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
# KiCad Project README | |
Welcome to the KiCad project! This repository contains all the files and documentation related to our project. Please refer to this README for important information and guidelines. | |
## Project Overview | |
- **Project Name:** [Your Project Name] | |
- **Project Description:** [Brief description of the project goals and objectives] | |
## Project Checklist |
This file contains hidden or 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 | |
# Item API Basic Product Search | |
import urllib.request # Query API | |
import json # Parsing API response | |
import os # For cache support | |
def get_url_content(url: str) -> str: | |
""" | |
Retrieves the content of a given URL as a string. |
This file contains hidden or 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 urllib.request | |
import json | |
def get_url_content(url: str) -> str: | |
""" | |
Retrieves the content of a given URL as a string. | |
Args: | |
url (str): The URL to retrieve content from. |
This file contains hidden or 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
#!/bin/bash | |
# | |
# This script creates a hybrid ISO image (UDF + ISO9660/Rock Ridge/Joliet) | |
# using genisoimage. Although the UDF part is included, the volume label is | |
# subject to the ISO9660 limit (32 characters). | |
# | |
# Usage: ./create_iso.sh <source_folder> [<destination_iso_image>] | |
# Check for required dependencies | |
for cmd in genisoimage dvdisaster; do |
This file contains hidden or 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
/* ADC Linear Conversion Macros | |
Brian Khuu 2025 | |
ADC_MILLIVOLT_FROM_ADC_VAL(ADC_BIT_COUNT, MILLI_VOLT_REFL, MILLI_VOLT_REFH, ADC_VAL) = ( (MILLI_VOLT_REFL) + ((ADC_VAL) * (((MILLI_VOLT_REFH) - (MILLI_VOLT_REFL)) / (1 << (ADC_BIT_COUNT)))) ) | |
ADC_VAL_FROM_MILLIVOLT(ADC_BIT_COUNT, MILLI_VOLT_REFL, MILLI_VOLT_REFH, MILLIVOLT) = ( (((MILLIVOLT) - (MILLI_VOLT_REFL)) * (1 << (ADC_BIT_COUNT))) / ((MILLI_VOLT_REFH) - (MILLI_VOLT_REFL)) ) | |
*/ | |
// This is the linear conversion macros | |
#define ADC_MILLIVOLT_FROM_ADC_VAL(ADC_BIT_COUNT, MILLI_VOLT_REFL, MILLI_VOLT_REFH, ADC_VAL) ( (MILLI_VOLT_REFL) + ((ADC_VAL) * (((MILLI_VOLT_REFH) - (MILLI_VOLT_REFL)) / (1 << (ADC_BIT_COUNT)))) ) |
This file contains hidden or 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 ccache gcc -Wall -Wextra -Werror -O3 -std=gnu17 "$0" -o /tmp/a -lm && /tmp/a "$@"; exit | |
#include <stdint.h> | |
#include <stdio.h> | |
/* | |
Self Describing Error Code Enum Macro (Or other status tracking variables) V2 | |
Author: Brian Khuu (2024) | |
This is an idea I got for easier management of error codes and other enums. | |
The benefit of this approach is that it provides a way of having self |
This file contains hidden or 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
/* | |
Self Describing Error Code Enum Macro (Or other status tracking variables) In C | |
Author: Brian Khuu (2024) | |
This is an idea I got for easier management of error codes and other enums. | |
The benefit of this approach is that it provides a way of having self | |
documenting enumerated values which would be useful for debug loggers. | |
Ergo, your debug log could print the meaning of an error or status message. | |
*/ |
This file contains hidden or 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/tcc -run | |
// Bounded Value Macros (Useful for guarding against invalid integer ranges) | |
#define clamp_upper(value, max) ((value) < (max) ? (value) : (max)) | |
#define clamp_lower(value, min) ((value) > (min) ? (value) : (min)) | |
#define clamp_range(value, min, max) clamp_lower(min, clamp_upper(value, max)) | |
#define is_above_bound(value, max) ((value) > (max)) | |
#define is_below_bound(value, min) ((value) < (min)) | |
#define is_within_bound(value, min, max) ((value) >= (min) && (value) <= (max)) |
This file contains hidden or 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
# GNU Make 4.3 | |
# Built for x86_64-pc-linux-gnu | |
# Copyright (C) 1988-2020 Free Software Foundation, Inc. | |
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
# This is free software: you are free to change and redistribute it. | |
# There is NO WARRANTY, to the extent permitted by law. | |
# Make data base, printed on Sun Oct 27 22:42:28 2024 | |
# Variables |
This file contains hidden or 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 | |
# KiCADv8 Style Prettify S-Expression Formatter (sexp formatter) | |
# By Brian Khuu, 2024 | |
# This script reformats KiCad-like S-expressions to match a specific formatting style. | |
# Note: This script modifies formatting only; it does not perform linting or validation. | |
# Context: Compact element settings are added to support KiCAD-specific handling for readability, e.g., PCB_PLUGIN::formatPolyPts. | |
import os | |
import argparse | |
from pathlib import Path |
NewerOlder