Skip to content

Instantly share code, notes, and snippets.

View j0yu's full-sized avatar
👌

Joe Yu j0yu

👌
View GitHub Profile
@j0yu
j0yu / maya-border
Last active November 22, 2019 16:35
(In Maya) Output a dialog with all the available standard Qt Icons
w = QtGui.QDialog()
l = QtGui.QGridLayout(w)
row = 0
column = 0
for i in [
"closed", "end", "more", "open", "root-closed", "root-open", "single", "vline",
]:
p = QtGui.QPushButton(i)
s = p.style()
p.setIcon(QtGui.QIcon(":/branch-{}.svg".format(i)))
import maya.cmds as mc
print '\n'*8
print '-'*80
print "Deleting un-used anim curve nodes (they don't output to anything)"
print '-'*80
for curveType in ["animCurveTL", "animCurveTA", "animCurveTU", "animCurveTT" ]:
for curveNode in mc.ls(type=curveType):
if mc.listConnections(curveNode+'.output') is None:
class sweet:
sweetness=0
def __init__(self, inputSweetness):
print "I'm aliveeee"
self.sweetness = inputSweetness
def addSweetness(self, inputSweetness):
self.sweetness = self.sweetness + inputSweetness
@j0yu
j0yu / .bashrc
Last active September 9, 2017 19:14
INSTALL: Add me to .bashrc, OR if you do not have .bashrc, save me as .bashrc in home directory
Q() {
######################################################################################
## To use after "install", literally type in Q in terminal and press enter ##
## IF ERROR (Normally first install): Open a new Terminal window THEN type Q ##
######################################################################################
clear
TOTAL=$(quota -s | tail -1 | cut -d " " -f 20 | grep -o "[0-9]*")
USED=$(quota -s | tail -1 | cut -d " " -f 18 | grep -o "[0-9]*")
PERCENT=$(bc <<< "scale=2; $USED*100/$TOTAL" )
TOTAL=$(bc <<< "scale=3; $TOTAL / 1024")