Skip to content

Instantly share code, notes, and snippets.

View Kif11's full-sized avatar
🐁
Expanding digital frontier

Kirill Kovalevskiy Kif11

🐁
Expanding digital frontier
View GitHub Profile
@Kif11
Kif11 / run-util.sh
Last active August 31, 2016 06:57
Bash script to facilitade Python module dependency instalation and environment configuration
#!/usr/bin/env bash
# Get this scrip directory
CURDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Set basic environmental variables
export PYTHONPATH="$PYTHONPATH:$CURDIR/lib/python2.7/site-packages"
# Dependencies
DEPENDENCIES=(\
@Kif11
Kif11 / header.py
Last active August 31, 2016 06:56
Python file header comment
#!/usr/bin/env python
# author: Kirill Kovalevskiy
# e-mail: kovalewskiy@gmail.com
@Kif11
Kif11 / import-logging.py
Last active August 31, 2016 06:57
Simple logger import and config
import logging
logging.basicConfig(format='%(levelname)s: %(message)s')
log = logging.getLogger(__file__)
log.setLevel(logging.INFO)
@Kif11
Kif11 / current-script-directory.py
Last active August 31, 2016 06:57
Get current script directory
script_dir = os.path.dirname(os.path.realpath(__file__))
@Kif11
Kif11 / maya-dockable_window.py
Last active October 16, 2023 04:55
PyQt scaffold for creating dockable Maya window
from PySide import QtCore
from PySide import QtGui
from maya.app.general.mayaMixin import MayaQWidgetDockableMixin
class MainWindow(MayaQWidgetDockableMixin, QtGui.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent=parent)\
@Kif11
Kif11 / maya-undo-decorator.py
Last active March 2, 2024 09:40 — forked from schworer/undo_dec.py
quick and dirty Maya Python undo decorator
from functools import wraps
from maya import cmds
def undo(func):
""" Puts the wrapped `func` into a single Maya Undo action, then
undoes it when the function enters the finally: block """
@wraps(func)
def _undofunc(*args, **kwargs):
try:
# start an undo chunk