Nothing Special   »   [go: up one dir, main page]

Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active October 20, 2024 11:48
set -e, -u, -o, -x pipefail explanation
@WinkelCode
WinkelCode / install_portmaster_to_var.sh
Last active October 20, 2024 11:43
Work in progress
#!/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
@hansvdam
hansvdam / convert_directory.py
Last active October 20, 2024 11:42
fotos van bonnentjes hernoemen met AI
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
@matthiasbalke
matthiasbalke / helper.gradle
Last active October 20, 2024 11:40
Gradle resolveDependencies Task
// 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)
}
@arifd
arifd / yuyv422_to_rgb24.rs
Last active October 20, 2024 11:35
YUV to RGB in Rust
#![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
@DraTeots
DraTeots / ComPort over Network.md
Last active October 20, 2024 11:28
ComPort over Network
@ph33nx
ph33nx / adobe_exe_firewall_block_windows.bat
Last active October 20, 2024 11:23
Block All Adobe .exe files via Firewall on Windows Using Batch Script | Stop adobe apps to access internet
@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
@aakashjangidme
aakashjangidme / logging_utils.py
Created October 20, 2024 11:21
A modular Python logging utility using the logging module, QueueHandler, and QueueListener for colored console output, non-blocking logging, and execution time tracking to enhance application performance monitoring.
"""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:
@SizableShrimp
SizableShrimp / README.md
Last active October 20, 2024 11:21
How to setup shading with Minecraft Forge

How to setup shading with Minecraft Forge

Shading is the concept of packing external dependencies inside your jar so that they exist in production. Without this, using external libraries would produce ClassNotFoundExceptions when you run your mod jar outside of an IDE. This guide explains how to setup shading through Gradle.

Assumptions

This guide assumes that:

  • You are on ForgeGradle 5 or higher
  • You are on Gradle 7.0 or higher
@veekaybee
veekaybee / normcore-llm.md
Last active October 20, 2024 11:20
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models