Skip to content

Instantly share code, notes, and snippets.

@nafeesb
nafeesb / python.md
Last active March 20, 2024 22:23
Useful python

Script dir

os.path.dirname(os.path.realpath(__file__))

Clear tqdm error

tqdm._instances.clear()

Extend namedtuple with methods

ExperimentProps = namedtuple( 'ExperimentProps', config.keys() )
class Experiment(ExperimentProps):
@nafeesb
nafeesb / ue-python.md
Last active August 11, 2019 20:29
Unreal engine python snippets

Preamble

import unreal_engine as ue
from unreal_engine.classes import PoseableMeshComponent, SkeletalMesh, Skeleton, SkeletalMeshComponent
from unreal_engine import FTransform, FVector, FRotator, FQuat, FSoftSkinVertex

Access object from editor

actor = ue.editor_get_selected_actors()[0]
@nafeesb
nafeesb / zmq_pubsub.py
Created April 16, 2019 01:28
Example PUB/SUB from PyZMQ
import zmq
import sys,os,time
#%%
port = '5563'
def server():
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind('tcp://*:%s' % port)
@nafeesb
nafeesb / CMakeNotes.md
Last active August 8, 2023 17:09
CMake b*lls*it

CMake is a haneous piece of software, but somehow it has more popularity than others. These are my notes on inane BS I have to deal with time to time in CMake.

CMAKE_DEBUG_POSTFIX

Postfix like _Debug and _Release added to library names in windows.

Verbose Makefile

-DCMAKE_VERBOSE_MAKEFILE=true or make VERBOSE=1

@nafeesb
nafeesb / MayaDebug.md
Last active February 8, 2024 20:35
Maya python interactive debugging with Visual Studio Code
@nafeesb
nafeesb / tflite.md
Last active December 4, 2019 20:46
Keras Tensorflow TFLite common idioms