Skip to content

Instantly share code, notes, and snippets.

View JokerMartini's full-sized avatar
😀

John Martini JokerMartini

😀
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace DirectoryTree
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace DirectoryTree
@JokerMartini
JokerMartini / Toggle GroupBox Collapse | .py
Created November 4, 2015 14:44
Python Pyside: Toggle the expansion of a groupbox in pyside using the groupbox.
import sys
from PySide import QtGui, QtCore
class Example(QtGui.QWidget):
def __init__(self,):
super(Example, self).__init__()
self.initUI()
@JokerMartini
JokerMartini / Class Inheritance 01| .py
Last active July 5, 2017 14:17
Python: Simple example of class inheritance
import sys
class Animal:
def __init__(self):
print "Animal created"
def whoAmI(self):
print "Animal"
def eat(self):
@JokerMartini
JokerMartini / Custom QTreeWidgetItem | .py
Created November 5, 2015 18:14
Pyside Python: Demonstrates how to create a custom QTreeWidgetItem in pyside.
#!/bin/env python
# ------------------------------------------------------------------------------
# Imports
# ------------------------------------------------------------------------------
import sys
from PySide import QtCore, QtGui
# ------------------------------------------------------------------------------
# Open UI
@JokerMartini
JokerMartini / Popup Rename Dialog - OK + Cancel | .py
Last active July 5, 2017 14:17
Pyside Pythong: Demonstrates a popup dialog used to edit names and returns true/false along with value.
import re
from PySide import QtGui, QtCore
from PySide.QtGui import QDialog, QVBoxLayout, QDialogButtonBox, QDateTimeEdit, QApplication
from PySide.QtCore import Qt, QDateTime
class RenameDialog(QDialog):
def __init__(self, parent = None):
super(RenameDialog, self).__init__(parent)
@JokerMartini
JokerMartini / Rename Dictionary Key | .py
Last active June 18, 2022 18:04
Python: Renames recursively every key in a dictionary to lowercase.
import sys
data = {
'MIKE' : ['Great'],
'SUE' : ['happy'],
'JAN' : ['sad']
}
for k, v in data.items():
print k, v
@JokerMartini
JokerMartini / Returns Select Information for QTreeWidget | .py
Created November 11, 2015 19:43
Pyside Python: returns[0] true if all items selected are the same level in hierarchy tree. returns[1] unique list of all levels containing a item selected. returns[2] select items
#!/bin/env python
# ------------------------------------------------------------------------------
# Imports
# ------------------------------------------------------------------------------
import sys
from PySide import QtCore, QtGui
# ------------------------------------------------------------------------------
# Open UI
@JokerMartini
JokerMartini / Colorpicker | .py
Created November 12, 2015 17:16
Pyside Pthon: A simple color picker using pyside and python.
import sys
from PySide import QtGui
class Example(QtGui.QWidget):
def __init__(self):
super(Example, self).__init__()
self.initUI()
@JokerMartini
JokerMartini / Mirror Matrix Across Axis | .ms
Last active September 18, 2023 09:07
Maxscript: Mirrors and object's matrix across an axis in 3ds Max.
--Create a point
p=point pos:[-20,0,0] size:20 axistripod:true box:true
--Rotate it 90 in z
rotate p (eulerAngles 0 0 45)
--Get the transform matrix to work with.
tm=p.transform
--Mirror the tm across the world matrix in x