Skip to content

Instantly share code, notes, and snippets.

View justinfx's full-sized avatar

Justin Israel justinfx

View GitHub Profile
@justinfx
justinfx / client.go
Created September 3, 2024 05:12
grpc retryPolicy breaking with server grpc+http/2 h2c mux on same port
package main
import (
"context"
"flag"
"log"
"time"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
import math
import pymel.core as pm
def insertKeyframeBetweenKeys():
try:
objects = pm.ls(sl=1)
attrs = pm.selectionConnection('graphEditor1FromOutliner', q=1, object=1)
for attr in attrs:
buffer = attr.split(".")
@justinfx
justinfx / list_edit.py
Created April 21, 2023 22:26
Qt examples of tracking QListWidget item text edits
"""
"Connect rename command in QListWidget item edit"
https://groups.google.com/g/python_inside_maya/c/lPoWGuXyFsg/m/sLiWOaJgBAAJ
"""
from PySide2 import QtCore, QtGui, QtWidgets
class MyListWidget(QtWidgets.QListWidget):
@justinfx
justinfx / tree_widget_drag.py
Created February 20, 2020 04:45
Capturing the start and end item/index information in a PySide2 QTreeWidget internal drag and drop
"""
https://groups.google.com/d/msg/python_inside_maya/1EzNG_i9Xes/Au-18UaXAwAJ
Capturing the start and end item/index information in a
PySide2 QTreeWidget internal drag and drop
"""
from __future__ import print_function
from PySide2 import QtCore, QtGui, QtWidgets
@justinfx
justinfx / read_proto_desc.py
Created July 14, 2019 06:15
Dynamically reading a Protobuf FileDescriptorSet file into Python message classes
#!/usr/bin/env python
"""
Read a serialized Protobuf FileDescriptorSet that was
generated from the protoc tool, and dynamically generate
the python classes for each message.
"""
import sys
from google.protobuf import descriptor_pb2
from google.protobuf import reflection
@justinfx
justinfx / qt_proxy_model.py
Created June 17, 2019 05:53
Minimal Qt example of adding a "virtual row" via a proxy model
#!/usr/bin/env python
"""
Refs:
"[Maya-Python] Customized display of files/folders in a QTreeView that is using QFileSystemModel."
https://groups.google.com/d/topic/python_inside_maya/TaFm2yNToJ8/discussion
"""
from PySide import QtCore, QtGui
@justinfx
justinfx / libtest.cc
Last active January 31, 2019 20:51
cython: test converting py2/3 string objects to C++ std::string
#include "libtest.hh"
std::string copy_string(std::string &s) {
std::string s2 = s;
return s2;
}
@justinfx
justinfx / README.md
Last active January 11, 2019 04:47
Repro of nats-io subscribe queue not evenly load balancing to idle workers

Build

go build worker.go
go build sender.go

Test

Start gnatsd server and 3 worker processes. Then run test to send 3 messages at once. It is expected that all 3 messages are picked up by 3 idle workers, and this may happen on

@justinfx
justinfx / badger_close_test.go
Created July 9, 2018 22:59
An example of a test that causes a badgerdb crash with a misleading error string
package main
import (
"os"
"testing"
"github.com/dgraph-io/badger"
)
/*
#!/usr/bin/env python
"""
Pipes experiment.
Refs: https://gist.github.com/mottosso/dd59f815025e4d76f453f3555e39558e
"""
import os
import sys
import time
import argparse