Skip to content

Instantly share code, notes, and snippets.

View ZdenekM's full-sized avatar

Zdeněk Materna ZdenekM

View GitHub Profile
@mzabriskie
mzabriskie / README.md
Last active May 22, 2024 16:53
Check git status of multiple repos

If you're like me you have a dir like ~/Workspace/Github where all your git repos live. I often find myself making a change in a repo, getting side tracked and ending up in another repo, or off doing something else all together. After a while I end up with several repos with modifications. This script helps me pick up where I left off by checking the status of all my repos, instead of having to check each one individually.

Usage:

git-status [directory]

This will run git status on each repo under the directory specified. If called with no directory provided it will default to the current directory.

@dylanfries
dylanfries / Events & Delegates in Unity C#
Last active November 2, 2023 21:42
Events and Delegates for Unity (C#)
Events & Delegates
------------------
Events and Delegates were something I struggled with when I was first learning how they worked. Once I figured it out it became one of the most useful and powerful techniques for games. Its especially useful for helping to decouple classes while allowing for messaging.
Delegates - Simply a container for a function that can be used as a variable.
Events - Allows you to specify a delegate that gets called when some event in your code is triggered.
Overview
@yiwenlu66
yiwenlu66 / udpbroadcast.py
Last active December 20, 2022 17:56
udp broadcast with asyncio
import asyncio
import socket
from string import ascii_letters
import random
class BroadcastProtocol:
def __init__(self, loop):
self.loop = loop
//modified from http://ilkinulas.github.io/development/unity/2016/04/30/cube-mesh-in-unity3d.html
//modification adds the ability to specify an offset and size
void CreateCube(Vector3 offset, Vector3 size) {
Vector3[] vertices = {
new Vector3 (0, 0, 0),
new Vector3 (1, 0, 0),
new Vector3 (1, 1, 0),
new Vector3 (0, 1, 0),
new Vector3 (0, 1, 1),
@EpicWink
EpicWink / _dataclass_patch.py
Last active October 4, 2022 12:02
Support non-defaulted after defaulted fields in dataclasses
"""Patch ``dataclasses`` to support optional after required fields.
Fields used in ``__init__`` without defaults are currently not allowed
after fields with defaults, due to the specification in PEP 557. This
patch allows these fields, but makes them required keyword-only
parameters to ``__init__``.
To apply this patch, simply import this module before defining any
dataclasses.
"""
@GluTbl
GluTbl / client.py
Last active June 13, 2023 16:41
[UDP audio streaming] #python
import pyaudio
import socket
from threading import Thread
frames = []
def udpStream():
udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
while True: