Skip to content

Instantly share code, notes, and snippets.

View matan-h's full-sized avatar

matan h matan-h

View GitHub Profile
@matan-h
matan-h / split-by-color.py
Last active December 9, 2023 21:13
A simple Python CLI to split images by colors using sklearn kmeans
# Mostly written by ChatGPT
# to download : curl -OL https://gist.githubusercontent.com/matan-h/e05eaa86c243b4707994c58b79faf4a0/raw/6322806f8f2a6e81bec09584895f9381b64fabc0/split-by-color.py
# dependencies: pip install numpy scikit-learn opencv-python rich-click
try:
import rich_click as click
except ModuleNotFoundError:
import click
import cv2
import numpy as np
@matan-h
matan-h / how-to-add-mintinstall-to-ubuntu.md
Last active April 13, 2022 14:02
how to add mint store to ubuntu

mintinstall is available in [mint packages][1]:

  1. Add the repository:
 sudo sh -c 'echo "deb http://packages.linuxmint.com/ elsie main" >> /etc/apt/sources.list.d/mint.list'
  1. run an update to retrieve information about what packages are available:
sudo apt-get update
@matan-h
matan-h / recplacer.py
Created March 21, 2021 15:27
Simplifies the python frame replace (support python 2 and 3)
from __future__ import print_function
from types import FrameType
import inspect
import sys
if sys.version_info[0] < 3:
inp = raw_input
else:
inp = input
@matan-h
matan-h / libconfig.ini
Last active July 20, 2020 17:36
python libtool ini file example
#libconfig.ini
[info]
test_file=test.py
author=your name
email=your email
description = description of the library
url=your website url (or github url)
#dependencies
install_requires=libraries needed for your library to run correctly. When your project is installed pip will install these libraries
license=license(I recommend MIT)
@matan-h
matan-h / test.py
Last active July 20, 2020 17:39
python libtool test.py example
#test.py
from packagename.Filename import Classname
from packagename.Filename1 import Functionname
if __name__ == '__main__': # must have this line after the import and before the examples
#write all your library examples here
#like:c=Classname()