- jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
- Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
- AngularJS - Conventions based MVC framework for HTML5 apps.
- Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
- lawnchair - Key/value store adapter for indexdb, localStorage
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
#Open New Maya | |
from subprocess import call | |
appPath = "/Applications/Autodesk/maya2014/Maya.app" | |
call(["open -n " + appPath], shell=True) |
'ScriptManager' gives both Maya users & developers a simple and standardized workflow for the installation and removal of 3rd-party Maya scripts. Files are stored and maintained in an organized fashion, doing away with the process of hand-copying files into their intended Maya folders.
def getFilteredList(list=[], pfx='', sfx=''): | |
filteredList = [] | |
for item in list: | |
isMatch = False | |
if pfx and not sfx: isMatch = item.startswith(pfx) | |
if not pfx and sfx: isMatch = item.endswith(sfx) | |
if pfx and sfx: isMatch = item.startswith(pfx) and item.endswith(sfx) | |
if isMatch: filteredList.append(item) | |
return filteredList |
<? | |
/** | |
* | |
* Returns an array as JSON formatted data | |
* | |
*/ | |
// Automatically Gather Images from a directory | |
$autoImageList = array(); | |
foreach(glob('./images/*.{jpg,png,gif}') as $filename){ |
So in Python you have 3 major tools for code organization…Modules, Classes, & Objects
Python modules are pretty much just a single python file. You can think about it as giving your variables and functions a specific namespace to reference within another python script. For example: The code below imports the contents of "mySampleModule.py" to allow all it's contents to be used in another python script under it's namespace (by default, the filename).
import mySampleModule
''' | |
This fixes a RRM bug (v1.4.7) where saved RRM setups do not preserve a | |
module's 'pinned' status. | |
''' | |
import maya.cmds as cmds | |
import maya.mel | |
def RRM_fixPinBug(objs): | |
for obj in objs: | |
trans = cmds.xform(obj,q=True, r=True, translation=True) | |
maya.mel.eval("RRM_PinProxies(1, 0);") |
import maya.cmds as cmds | |
def activateCommandPort(host='127.0.0.1', port='7002', language="python"): | |
path = host + ":" + port | |
active = cmds.commandPort(path, q=True) | |
if not active: | |
cmds.commandPort(name=path, sourceType=language) | |
else: | |
print("%s is already active" % path) |
class DataModel | |
constructor: () -> | |
@data = {} | |
@callbacks = | |
set: [] | |
unset: [] | |
return | |
applyCallbacks: (action, args) -> | |
for cb in @callbacks[action] |