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
func generateRandomColor() -> UIColor { | |
let hue : CGFloat = CGFloat(arc4random() % 256) / 256 // use 256 to get full range from 0.0 to 1.0 | |
let saturation : CGFloat = CGFloat(arc4random() % 128) / 256 + 0.5 // from 0.5 to 1.0 to stay away from white | |
let brightness : CGFloat = CGFloat(arc4random() % 128) / 256 + 0.5 // from 0.5 to 1.0 to stay away from black | |
return UIColor(hue: hue, saturation: saturation, brightness: brightness, alpha: 1) | |
} |
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
###################### | |
# Options | |
###################### | |
REVEAL_ARCHIVE_IN_FINDER=false | |
FRAMEWORK_NAME="${PROJECT_NAME}" | |
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework" |
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
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
#ifdef _MSC_VER | |
#define snprintf(output,len,fmt,... ) sprintf_s(output,len,fmt,##__VA_ARGS__) | |
#endif // _MSC_VER | |
#ifdef DEBUG_DUMP_HEX_ | |
#define DUMP_HEX_VVLOG printf("[%d]maxLen=%d offset=%d delta=%d \n",__LINE__,maxLen,offset,(maxLen-offset)); | |
#else | |
#define DUMP_HEX_VVLOG | |
#endif | |
int DumpHex(char* buffer,int maxLen, const char* input, int len) { |
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
echo "--------- Begin Nginx ---------" | |
echo "--------- install and update tools ---------" | |
#更新 | |
yum -y update | |
#安装依赖,以及git | |
yum -y install gcc openssl-devel pcre-devel zlib-devel libtool gcc-c++ build-essential git make which wget | |
echo "--------- prepare files ---------" | |
if [ ! -d nginx ]; then |