Skip to content

Instantly share code, notes, and snippets.

View SatishGodaPearl's full-sized avatar

Satish Goda SatishGodaPearl

View GitHub Profile
@shakna-israel
shakna-israel / Prose.md
Last active November 15, 2023 22:06
Obfuscating Python

Obfuscating Python

Obfuscation isn't difficult in most programming languages. It's why we have "good practices" because it is so easy to hide what you mean in badly written code.

Obfuscation tends to be even easier in dynamic languages because of how forgiving they tend to be - and because they tend to give you direct access to the environment so that you can manipulate it.

Today, for fun, I'm going to obfuscate this code:

def _(n):

if n <= 0:

@Wahooney
Wahooney / blender-update.ps1
Last active September 5, 2019 14:20
Blender auto-updater Powershell script. Check the Readme section (after license) for instructions. Use at your own risk.
# MIT License
# Copyright (c) 2019 Keith Boshoff (Wahooney)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@BigRoy
BigRoy / blender28_run_qt_ui.py
Created August 1, 2019 10:04
Simple example of running a Qt interface in Blender 2.8 without blocking Blender.
import bpy
from PyQt5 import QtWidgets
class QtModalOperator(bpy.types.Operator):
"""A base class for Operators that run a Qt interface."""
def modal(self, context, event):
if self._app:
@Kif11
Kif11 / obj_in_frust.py
Created June 7, 2017 17:11
Maya script to find if object located within camera frustum
import maya.cmds as cmds
import maya.OpenMaya as OpenMaya
import math
# Find if object located within camera frustum
# Usage:
# from obj_in_frust import in_frustum
# in_frustum('camera1', 'pCube1')
class Plane(object):
@vshotarov
vshotarov / shelfBase.py
Last active May 29, 2024 03:59
Maya base class for building custom shelves.
import maya.cmds as mc
def _null(*args):
pass
class _shelf():
'''A simple class to build shelves in maya. Since the build method is empty,
it should be extended by the derived class to build the necessary shelf elements.
@fredrikaverpil
fredrikaverpil / export_nodes_and_store_node_data.py
Last active February 1, 2022 14:25
Export and re-assign shaders, nodes and node data #maya
import maya.cmds as cmds
def getAttributes(object):
attributes = cmds.listAttr(object)
for attribute in attributes:
try:
print attribute + ' = ' + str(cmds.getAttr(object + '.' + attribute))
except:
pass
@jaytaylor
jaytaylor / camel_case_to_snake_case.py
Created September 6, 2012 21:41
Convert camel-case to snake-case in python.
#!/usr/bin/env python
"""
Convert camel-case to snake-case in python.
e.g.: CamelCase -> snake_case
Relevant StackOverflow question: http://stackoverflow.com/a/1176023/293064
"""