Skip to content

Instantly share code, notes, and snippets.

View metal3d's full-sized avatar
Electrifying my brain

Patrice Ferlet metal3d

Electrifying my brain
View GitHub Profile
@metal3d
metal3d / Pipfile
Created March 13, 2024 08:09
Generate French products in JSON with AI, using LM Studio or OpenAI
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
openai = "*"
rich = "*"
[dev-packages]
@metal3d
metal3d / main.go
Last active September 5, 2023 06:37
Go + Fyne + V4L
package main
import (
"bytes"
"context"
"image"
"log"
"sync"
_ "image/jpeg"
@metal3d
metal3d / gist:a401d2209e6e2df4cc8c321afd10ef28
Created August 29, 2023 13:43
Scoreboard - Data Confidentiality
Data confidentiality
This application does not store any personal data and consequently does not transmit any data to a third party.
@metal3d
metal3d / Makefile
Created July 11, 2023 13:37
Clean git version in your Makefile
# Get the current clean version from your git repo
# - -tagname if the current commit is tagged and no changes were detected
# - branchname-sha if not
# - branchname-sha-dirty if changes were detected and not commited
# Use $(VERSION) to get it, wherever you want in your commands
VERSION=$(shell \
git describe --exact-match --tags --dirty 2>/dev/null || \
printf "%s-%s%s" \
$(shell git branch --show-current) \
$(shell git log -n1 --pretty=%h) \
@metal3d
metal3d / grahical-install.sh
Last active June 9, 2023 12:45
Create kind cluster + projectcontour ingress controller
#!/bin/bash
# Check helm, kubectl and kind
NEEDED=""
for cmd in helm kubectl kind pkexec; do
if ! command -v $cmd >/dev/null 2>&1; then
NEEDED="$NEEDED $cmd"
fi
done
if [ -n "$NEEDED" ]; then
@metal3d
metal3d / gaussianBlu.go
Created April 13, 2022 17:25
Gaussian filter / blur with Golang
package blur
import (
"image"
"image/color"
"image/png"
_ "image/png"
"math"
)
""" Create dataset """
import os
import uuid
import cv2 as cv
DATA_DIR = "data"
DIRECTIONS = ["up", "down", "right", "left", "neutral"]
@metal3d
metal3d / matrux.sh
Created December 21, 2021 10:14
Matrix in terminal
lines=$(tput lines)
cols=$(tput cols)
awkscript='
{
lines=$1
random_col=$3
letter=$4
letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"
letter=substr(letters,letter,1)
@metal3d
metal3d / create-couchbas-pods.sh
Last active December 13, 2021 12:51
Start Couchbase with podman
# Configuration
count=4
clustername=mycluster
admin=admin
password=password
networkname=couchbase
volumename=couchbase
# inside the pods, do not change it
@metal3d
metal3d / manual-classification.py
Created June 28, 2021 12:22
Manual classification to a target directory to "good" and "bad" images
""" UI to manually class bad/good images """
import os
import sys
from glob import glob
import cv2 as cv
directory = sys.argv[1]
if not directory:
sys.exit(1)