Skip to content

Instantly share code, notes, and snippets.

View dgaitsgo's full-sized avatar

David Gaitsgory dgaitsgo

View GitHub Profile
@dgaitsgo
dgaitsgo / auto-check.js
Created February 16, 2020 03:07
Auto-check swasdfasd
const blackListedRouterError =
Number(
[...document.querySelectorAll("th")]
.filter(a => a.textContent.includes("[FILTERED] blacklisted"))
[0]
.nextSibling
.innerText
) > 0
initImageHoverListeners = (image: HTMLImageElement): void => {
const imageButtonId = 'bai-image-btn-container'
const imageLink = this.getImageContainer(image)
const buttonContainer = this.getButtonContainer('image')
if (imageLink) {
const wrapper = imageLink.parentNode
wrapper?.addEventListener('mouseover', (e) => {
if (e.target === image) {
document.getElementById(imageButtonId)?.remove()
@dgaitsgo
dgaitsgo / fragment.glsl
Created April 25, 2022 02:27
Basic ThreeJS TypeScript setup
varying vec2 vUv;
void main() {
gl_FragColor = vec4(vUv, 0.0, 1.);
}
@dgaitsgo
dgaitsgo / next-comp
Created July 13, 2022 03:08
New React/CSS Module TS Component
#!/bin/bash
if [ "$1" == "" ]; then
echo "Missing $component name"
exit 0
fi
for comp in "$@"
do
if [ ! -d ./$comp ]; then
@dgaitsgo
dgaitsgo / match-histogram.py
Created November 7, 2023 01:25
Histogram matching open-cv
import cv2
# Load the reference and target images
reference_image = cv2.imread('reference_image.jpg')
target_image = cv2.imread('target_image.jpg')
# Convert to LAB color space (preserves color information)
reference_image_lab = cv2.cvtColor(reference_image, cv2.COLOR_BGR2LAB)
target_image_lab = cv2.cvtColor(target_image, cv2.COLOR_BGR2LAB)