Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import itertools | |
def unpackDefault(datas, length=3, default=None): | |
datas.extend([default for i in range(length-len(datas))]) | |
return datas | |
def unpackDefault2(datas, length=3, default=None): | |
return itertools.islice(itertools.chain(iter(datas), itertools.repeat(default)), length) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import Popen, PIPE | |
p = Popen('ls -l', stdout=PIPE, stderr=PIPE) | |
stdout, stderr = p.communicate() | |
print stdout, stderr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
import re | |
import functools | |
def validateTextFieldUserInput(widget, pattern, fallback, callback, input): | |
if re.match(pattern, input): | |
callback(input) | |
else: | |
fallback(widget) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import math | |
import re | |
def unpackDefault(data, length=3, default=None): | |
""" | |
This definition unpacks given sequence enforcing a given length. | |
:param data: Sequence to unpack. ( Tuple / List ) | |
:param length: Default length to unpack to. ( Integer ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
def ascendantsWalker(path, visitor=None): | |
parents = cmds.listRelatives(path, allParents=True, fullPath=True) | |
if not parents: | |
return | |
for parent in parents: | |
visitor and visitor(parent) | |
yield parent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
for transform in cmds.ls(sl=True, l=True): | |
point = cmds.xform("{0}.vtx[0]".format(transform), q=True, t=True, ws=True) | |
for pivotType in ("scalePivot", "rotatePivot"): | |
cmds.move(point[0], point[1], point[2], "{0}.{1}".format(transform, pivotType)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from hashlib import sha1 | |
def getHashes(data, fill=5): | |
hash = sha1(data).hexdigest() | |
return hash, "{0}{1}".format("0"*fill, hash[fill:]) | |
hashes = getHashes("password") | |
for line in file("combo_not.txt", "r"): | |
if line.strip() in hashes: | |
print "Hashe(s) found: '{0}'".format(hashes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- Makefile -*- | |
# Mac OSX makefile for FreeImage | |
# This file can be generated by ./gensrclist.sh | |
include Makefile.srcs | |
# General configuration variables: | |
CC_X86_64 = gcc | |
CPP_X86_64 = g++ | |
COMPILERFLAGS = -Os -fexceptions -fvisibility=hidden -DNO_LCMS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: python | |
python: | |
- "2.6" | |
- "2.7" | |
before_install: | |
- cd .. | |
- curl -O http://www.riverbankcomputing.co.uk/static/Downloads/sip4/sip-4.13.3.tar.gz | |
- tar -xvf sip-4.13.3.tar.gz | |
- cd sip-4.13.3 | |
- python configure.py |