Discover gists
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 -e # Exit on error | |
if [ "$EUID" -ne 0 ]; then | |
echo "To ensure correct permissions, this script must be run as root." | |
exit 1 | |
fi | |
install_location="/var/lib/safing-portmaster" # Must not include trailing slash |
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 base64 | |
import os | |
import openpyxl | |
from langchain.chains.transform import TransformChain | |
from langchain_core.messages import HumanMessage | |
from langchain_openai import ChatOpenAI, OpenAI | |
from openai.types import image_model | |
from pathlib import Path | |
from openpyxl.styles import PatternFill | |
from openpyxl.utils import get_column_letter |
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
// found here: http://jdpgrailsdev.github.io/blog/2014/10/28/gradle_resolve_all_dependencies.html | |
task resolveDependencies { | |
doLast { | |
project.rootProject.allprojects.each { subProject -> | |
subProject.buildscript.configurations.each { configuration -> | |
resolveConfiguration(configuration) | |
} |
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
#![allow(dead_code)] | |
//! https://www.kernel.org/doc/html/v4.17/media/uapi/v4l/pixfmt-yuyv.html | |
//! | |
//! V4L2_PIX_FMT_YUYV — Packed format with ½ horizontal chroma resolution, also known as YUV 4:2:2 | |
//! Description | |
//! | |
//! In this format each four bytes is two pixels. Each four bytes is two Y's, a Cb and a Cr. Each Y goes to one of the pixels, and the Cb and Cr belong to both pixels. As you can see, the Cr and Cb components have half the horizontal resolution of the Y component. V4L2_PIX_FMT_YUYV is known in the Windows environment as YUY2. | |
//! | |
//! Example 2.19. V4L2_PIX_FMT_YUYV 4 × 4 pixel image |
(Serial port or com port? - Serial ports are often refered as COM ports. It is the same to be short. You can read abut it in the Wiki article )
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
@REM Author: https://github.com/ph33nx | |
@REM Description: This script blocks or unblocks Adobe-related executables in Windows Firewall. | |
@REM Usage: | |
@REM - To block executables: adobe_block.bat | |
@REM - To unblock (delete) existing rules: adobe_block.bat -delete | |
@echo off | |
setlocal enabledelayedexpansion | |
REM Check if the script should delete existing rules |
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
"""app/utils/logging_utils.py | |
A utility module for setting up colored logging in Python applications. | |
It leverages a background thread for logging to ensure that logging operations | |
do not block the main application flow, particularly in a Flask web application. | |
This module provides functions and classes to configure logging, format log messages, | |
and measure the execution time of functions. | |
Example usage: |
Shading is the concept of packing external dependencies inside your jar so that they exist in production.
Without this, using external libraries would produce ClassNotFoundException
s when you run your mod jar outside of an IDE.
This guide explains how to setup shading through Gradle.
This guide assumes that:
- You are on ForgeGradle 5 or higher
- You are on Gradle 7.0 or higher
NewerOlder