Skip to content

Instantly share code, notes, and snippets.

View whoiscarlo's full-sized avatar

Carlo Nyte whoiscarlo

View GitHub Profile
@whoiscarlo
whoiscarlo / gist:4c2b19f0ff4489c7e1a25720e0c5b964
Created May 12, 2023 23:26 — forked from pcmoritz/gist:4b0e1be7f2dfcc4e51e2ace50426f67d
Powerpoint create slides for animations while retaining slide numbers
Option Explicit
Sub AddElements()
Dim shp As Shape
Dim i As Integer, n As Integer
n = ActivePresentation.Slides.Count
For i = 1 To n
Dim s As Slide
Set s = ActivePresentation.Slides(i)

Create a new project

poetry new <project-name>

Add a new lib

poetry add <library>

Remove a lib

@whoiscarlo
whoiscarlo / create_image_sequence_read_node.py
Created December 23, 2022 03:06
Nuke - Create a read node from an image sequence
import os
import nuke
def get_padding(seqNumbers):
'''
Get correct number of padding for image sequence
'''
size = len(seqNumbers)
padding = ''

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@whoiscarlo
whoiscarlo / maya_testUI_qt.py
Created June 19, 2019 00:38
Create QT UI In Maya
from PyQt5 import QtWidgets
from PyQt5 import QtCore
from PyQt5 import QtGui
from maya import OpenMayaUI
from sip import wrapinstance
class Test_UI(QtWidgets.QWidget):
def __init__(self, *args, **kwargs):
@whoiscarlo
whoiscarlo / wraps_Demo.py
Last active April 16, 2018 22:25
Creator a decorator that will run a command and even if it fails toggles a state on and off
from functools import wraps
def my_decorator(f):
@wraps(f)
def inner_dec(*args, **kws):
try:
## turn state on
f(*args, **kws)
print('test')
finally:
@whoiscarlo
whoiscarlo / convertQT4toQT5.py
Last active March 13, 2024 12:12
Convert PyQt4 to PyQt5
import os, re, stat, sys, shutil
from PyQt5 import QtWidgets, QtCore
qtWidgets_modules = dir(QtWidgets)
qtCore_modules = dir(QtCore)
def fixFile(line_list):
line_generator = iter(line_list)
changed = False
@whoiscarlo
whoiscarlo / editMayaOutlinerMenuBar.py
Created January 25, 2018 19:02
Edit Maya Outliner MenuBar
from maya import OpenMayaUi as omui
from maya import cmds, mel
import sip
from PyQt5 import QtCore, QtWidgets, QtGui
## Maya pointer to outliner widget
outliner_pointer = omui.MQtUtil.findControl('Outliner')
## Convert outliner maya pointer to QWidget
@whoiscarlo
whoiscarlo / mayaWidgetHierarchy.py
Last active July 29, 2019 07:11
Maya Widget Hierarchy
"""
Widget Hierarchy
"""
from PyQt5 import QtWidgets, QtGui, QtCore
from sip import wrapinstance
from maya import OpenMayaUI as omui
from maya.app.general.mayaMixin import MayaQWidgetBaseMixin
from pprint import pprint
@whoiscarlo
whoiscarlo / mayapy.sublime-build
Created January 3, 2018 20:14
Create a Sublime Build
{
"path": "C:/Autodesk/Maya2017-x64/bin/mayapy.exe",
"cmd": ["C:/Autodesk/Maya2017-x64/bin/mayapy.exe", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}