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 <Foundation/Foundation.h> | |
#import "Sparrow.h" | |
/// An SXGauge displays a texture, trimmed to its left side, depending on a ratio. | |
/// This can be used to display a progress bar or a time gauge. | |
@interface SXGauge : SPSprite | |
{ | |
@private | |
SPImage *mImage; | |
float mRatio; |
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: http://snipt.net/yonishin/about-xcode-4-project-template | |
XCode 4 Projects and Files Template Folder: /Developer/Library/Xcode/Templates | |
Examples: | |
/Developer/Library/Xcode/Templates/Project Templates/Base/Other/Empty.xctemplate | |
/Developer/Library/Xcode/Templates/Project Templates/Base/Base.xctemplate | |
/Developer/Library/Xcode/Templates/Project Templates/Mac/Mac Base.xctemplate | |
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Command Line Tool.xctemplate | |
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Cocoa Application.xctemplate |
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 mox | |
import stubout | |
#test function tearup | |
m = mox.Mox() | |
BigWorld = m.CreateMockAnything() | |
m.StubOutWithMock(BigWorld,"entities") | |
m.StubOutWithMock(BigWorld,"singleton") | |
#Great,prepare clientside input data for function be called. | |
BigWorld.entities.get(100).AndReturn(None) |
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
#!/usr/bin/python | |
# | |
#Notice:Please close domain lookup on your router or switch. | |
__author__="ring0" | |
__date__ ="$2011-6-5 16:00:00$" | |
__version__ ="0.3" | |
import sys | |
try: |
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
child = pexpect.spawn('su 3028') | |
child.expect(".word") | |
child.sendline("3028") | |
child.expect(".$") | |
child.sendline('cd ~') | |
child.sendline('/home/exe/mf204/bigworld/tools/server/control_cluster.py check') | |
r = child.expect([".not run",".run",pexpect.EOF]) | |
if r == 0: | |
child.sendline('/home/exe/mf204/bigworld/tools/server/control_cluster.py load simple') | |
print 'try load server' |
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 os | |
filters = ['.cpp','.h','.py','.hpp','.ipp','.sln','.vcproj','.mak'] | |
filters.extend(['.c','python','Makefile','php']) | |
#filters = ['python'] | |
#filters = ['*'] | |
if os.name == 'posix': | |
FOLDER_FIX = '/' | |
else: | |
FOLDER_FIX = "\\" |
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
#!/usr/bin/env python | |
#svn log -v -r 20146:20150 svn://192.168.1.230/tjspaces | |
#Author cnsoft 2011-09 | |
svncmd = "svn log -v -r %d:%d %s" | |
#Test | |
svnurl = "svn://192.168.1.230/tjspaces/" | |
# | |
outputpath = "d:\\packagetools" |
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
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
# | |
# Copyright (c) 2012, VPSMate development team | |
# All rights reserved. | |
# | |
# VPSMate is distributed under the terms of the (new) BSD License. | |
# The full license can be found in 'LICENSE.txt'. | |
""" Install script for VPSMate """ |
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
#!/bin/sh | |
#****************************************************************# | |
# ScriptName: yum_update.sh | |
# Author: baoqing.guobq | |
# Create Date: 2011-07-21 | |
# Modify Author: | |
# Modify Date: 2011-07-21 | |
# Function: | |
#***************************************************************# | |
mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.bak |
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 os | |
import subprocess | |
import re | |
def findThisProcess( process_name ): | |
ps = subprocess.Popen("ps -eaf | grep "+process_name, shell=True, stdout=subprocess.PIPE) | |
output = ps.stdout.read() | |
ps.stdout.close() | |
ps.wait() |