Skip to content

Instantly share code, notes, and snippets.

View egemenertugrul's full-sized avatar

egemenertugrul

View GitHub Profile
@egemenertugrul
egemenertugrul / binvox_rw.py
Last active January 17, 2020 08:05
binvox_rw.py modified for Python 3.6
View binvox_rw.py
# Copyright (C) 2012 Daniel Maturana
# This file is part of binvox-rw-py.
#
# binvox-rw-py is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# binvox-rw-py is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
View TCP_Server_py
# listen.py
from threading import Thread
import socket
import time
import sys
VERBOSE = False # Enables/Disables printing of debug messages
IP_PORT = 22000 # the port that tinkerboard listens to
TIME_INTERVAL = 10 # sec
@egemenertugrul
egemenertugrul / DynamicPlots.py
Last active November 7, 2022 11:39
Matplotlib Dynamic Multiple Subplots
View DynamicPlots.py
import math
from matplotlib import pyplot as plt
plt.ion()
class AxesWrapper:
def __init__(self, lines, ax, max_display_capacity=None):
self.lines = lines
@egemenertugrul
egemenertugrul / ResourcesExtension.cs
Last active January 3, 2023 09:14
StreamingAssets/Resources Extensions for Unity
View ResourcesExtension.cs
using System.Collections.Generic;
using System.IO;
using UnityEngine;
public static class ResourcesExtension
{
/// <summary>
/// Recursively traverses each folder under <paramref name="path"/> and returns the list of file paths.
/// It will only work in Editor mode.
/// </summary>
@egemenertugrul
egemenertugrul / full_duplex_server.py
Last active August 10, 2023 18:00
Python Websockets Full Duplex Asynchronous Multiprocessing Server
View full_duplex_server.py
import asyncio
import multiprocessing as mp
from websockets.server import serve
from websockets.exceptions import ConnectionClosedOK
import time
class DuplexWebsocketsServerProcess(mp.Process):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._send_queue = mp.Queue()