Skip to content

Instantly share code, notes, and snippets.

View patwooky's full-sized avatar

Patrick Woo patwooky

View GitHub Profile
@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):
@patwooky
patwooky / embedImageInSource_20161019.py
Created October 19, 2016 08:25
Embeds an image in source file
import os
import base64
headerImg = b'''
iVBORw0KGgoAAAANSUhEUgAAAfQAAAB/CAYAAAAZ1jAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAK
T2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AU
kSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXX
Pues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgAB
eNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAt
AGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3
@kaotika
kaotika / qprogressbar_thread.py
Last active November 12, 2022 10:10
Simple PyQt example with QThread and QProgressBar
from PyQt4 import QtCore, QtGui
import sys, time
class mythread(QtCore.QThread):
total = QtCore.pyqtSignal(object)
update = QtCore.pyqtSignal()
def __init__(self, parent, n):
super(mythread, self).__init__(parent)
@NSDesign
NSDesign / Matrix Rotation
Last active August 12, 2024 16:08
VEX : Matrix rotation about a pivot point
f@angle = chf("angle") * 2 * $PI; // angle is a float slider with range from 0 - 1
v@axis = chv("axis") + point(1, "N", 0); // axis is a 3 float vector {0.0, 0.0, 0.0}
3@imatrix = ident();
rotate(@imatrix, @angle, @axis);
@P = (@P - point(1, "P", 0)) * @imatrix + point(1, "P", 0);

Google Apps Script Spreadsheet Utilities and Custom Functions#

These utilities are grouped into related files, for simpler copy & paste to your scripts.

ConvertA1.gs

A couple of helper functions to convert to & from A1 notation.

cellA1ToIndex( string cellA1, number index )