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 | |
from math import sqrt, pow, cos, sin | |
import random | |
rand = random.random | |
R = 5 | |
for i in range(5000): | |
r = R * rand() | |
#r = R * pow(rand(), 1.0/3) | |
t = 6.2831853 * rand() # 2pi * u |
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
#include "SoSharedLibDefs.h" | |
#include "SoCClient.h" | |
#define EXPORT extern "C" __declspec(dllexport) | |
#define strdup _strdup | |
// ------------------------------------------------------------------ | |
// 宣言 | |
// ------------------------------------------------------------------ |
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.OpenMayaUI | |
from PySide import QtGui | |
import shiboken | |
import maya.cmds as cmds | |
panel = cmds.getPanel(scriptType="scriptEditorPanel")[0] | |
widget = maya.OpenMayaUI.MQtUtil.findLayout(panel) | |
scriptEditor = shiboken.wrapInstance(long(widget), QtGui.QWidget) | |
mainWindow = shiboken.wrapInstance(long(maya.OpenMayaUI.MQtUtil.mainWindow()), QtGui.QWidget) | |
win = QtGui.QDockWidget('test', parent=mainWindow) |
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
>>> fs = [] | |
>>> from pprint import pprint | |
>>> | |
>>> for i in range(4): | |
... a = str(i) | |
... func = lambda : pprint(a) | |
... fs.append(func) | |
... | |
>>> fs[0]() | |
'3' |
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
class ImgWidget(QtGui.QWidget): | |
def __init__(self, imagePath, x=None, y=None, parent=None): | |
super(ImgWidget, self).__init__(parent) | |
self.pic = QtGui.QPixmap(imagePath) | |
self.x = x | |
self.y = y | |
def paintEvent(self, event): |
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 pprint import pprint | |
from cStringIO import StringIO | |
stdout = StringIO() | |
def test(): | |
try: | |
a |
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
require 'formula' | |
class TmuxFix < Formula | |
url 'http://sourceforge.net/projects/tmux/files/tmux/tmux-1.5/tmux-1.5.tar.gz' | |
md5 '3d4b683572af34e83bc8b183a8285263' | |
homepage 'http://tmux.sourceforge.net' | |
depends_on 'libevent' | |
depends_on 'tmux-MacOSX-pasteboard' |
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
diff --git a/window-copy.c b/window-copy.c | |
index b49be33..9537ad5 100644 | |
--- a/window-copy.c | |
+++ b/window-copy.c | |
@@ -23,6 +23,7 @@ | |
#include "tmux.h" | |
+void to_pasteboard(char *buf); | |
struct screen *window_copy_init(struct window_pane *); |
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
./configure --prefix=/usr/local/python27 --enable-shared | |
yum install zlib-devel readline-devel openssl-devel bzip2-devel gdbm-devel |
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
sudo defaults write com.apple.loginwindow LoginHook /etc/rc.local | |
#!/bin/bash | |
# once | |
#sudo unlink /tmp | |
#sudo ln -s /Volumes/ramdisk /tmp | |
# Make RamDisk | |
if [ ! -d /Volumes/ramdisk ] |
NewerOlder