Skip to content

Instantly share code, notes, and snippets.

View TACIXAT's full-sized avatar
🌴
Good life

TACIXAT TACIXAT

🌴
Good life
View GitHub Profile
@TACIXAT
TACIXAT / halftone.py
Created July 16, 2024 11:03
Python implementation for converting images to halftone
import cv2
import drawsvg
import argparse
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image, ImageDraw
def show_raster(im):
im = cv2.cvtColor(im, cv2.COLOR_GRAY2RGB)
plt.figure()
@duckythescientist
duckythescientist / pcb_art_helper.py
Created June 26, 2024 02:51
Posterize a PNG and create layers for PCB art
#!/usr/bin/env python3
import sys
import os.path
import numpy as np
import skimage.io, skimage.color, skimage.transform
import sklearn.cluster
import matplotlib.pyplot as plt
@TACIXAT
TACIXAT / cutout.py
Last active July 17, 2024 22:47
Python OpenCV command line implementation for Photoshop's Cutout Filter
import cv2
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
import numpy as np
import random
import argparse
# big thanks to this answer for the sketch
# https://stackoverflow.com/a/63647647/1176872
@Treeki
Treeki / TurnipPrices.cpp
Last active July 8, 2024 02:08
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@ankitshekhawat
ankitshekhawat / PIL_to_datauri.py
Last active December 6, 2021 05:53
Convert PIL image to DataURI
#python3
def pil2datauri(img):
#converts PIL image to datauri
data = BytesIO()
img.save(data, "JPEG")
data64 = base64.b64encode(data.getvalue())
return u'data:img/jpeg;base64,'+data64.decode('utf-8')
@illia-v
illia-v / sha512.py
Last active June 17, 2024 18:08
Simple pure Python 3.6 implementation of SHA-512 algorithm
#!/usr/bin/env python3.6
__author__ = 'Illia Volochii'
__license__ = 'MIT'
import binascii
import struct
initial_hash = (
0x6a09e667f3bcc908,
0xbb67ae8584caa73b,
@samdutton
samdutton / sample.vtt
Created February 2, 2018 01:52
Sample WebVTT caption file
WEBVTT
00:00:00.500 --> 00:00:02.000
The Web is always changing
00:00:02.500 --> 00:00:04.300
and the way we access it is changing
@jozsefsallai
jozsefsallai / GoHTML.sublime-syntax
Last active June 20, 2024 16:04
Go HTML template syntax highlighting for Sublime Text
%YAML 1.2
---
name: 'GoHTML'
file_extensions:
- gohtml
- html.go
scope: text.html.gohtml
contexts:
main:
- match: ''
@ebraminio
ebraminio / upload.go
Last active March 22, 2023 06:01
golang upload client and server
// curl -X POST -H "Content-Type: application/octet-stream" --data-binary '@filename' http://127.0.0.1:5050/upload
package main
import (
"fmt"
"io"
"net/http"
"os"
"time"
@potatoqualitee
potatoqualitee / Test-Faf.ps1
Last active February 24, 2021 15:11
Insanely fast CSV to SQL Server imports using the FAF technique (batched datasets and in-line multithreading)
<#
PowerShell, SqlBulkCopy and RunSpaces Speed Test
-- To be used for speed testing purposes with million.csv --
-- Will drop and recreate specified database if it exists --
This script will
- Automatically download the million row dataset if it doesn't exist
- Drop the specified database if it exists