Skip to content

Instantly share code, notes, and snippets.

View mirosval's full-sized avatar

Miroslav Zoričák mirosval

View GitHub Profile
@sgdan
sgdan / gzip.kts
Last active April 4, 2024 06:02
Kotlin code to compress/uncompress a string with gzip
import java.io.ByteArrayOutputStream
import java.io.File
import java.nio.charset.StandardCharsets.UTF_8
import java.util.zip.GZIPInputStream
import java.util.zip.GZIPOutputStream
fun gzip(content: String): ByteArray {
val bos = ByteArrayOutputStream()
GZIPOutputStream(bos).bufferedWriter(UTF_8).use { it.write(content) }
return bos.toByteArray()
@odebeir
odebeir / gist:5237529
Last active November 8, 2021 12:49
Small python code for building Gabor filters
# opencv
import cv2.cv as cv
import cv2
def build_filters():
""" returns a list of kernels in several orientations
"""
filters = []
ksize = 31
for theta in np.arange(0, np.pi, np.pi / 32):