Skip to content

Instantly share code, notes, and snippets.

enefry

Block or report user

Report or block enefry

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@enefry
enefry / generateRandomColor.swift
Created Dec 29, 2017 — forked from asarode/generateRandomColor.swift
Generating random UIColor in Swift
View generateRandomColor.swift
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)
}
View gist:508a982e4db757db46f73f17f54a390e
######################
# Options
######################
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
@enefry
enefry / gist:dfb62b6bcb4b59dd690e9ba78f355953
Created Aug 1, 2017 — forked from shazron/gist:943736
About XCode 4 Project Template (How To Create Custom Project Template)
View gist:dfb62b6bcb4b59dd690e9ba78f355953
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
@enefry
enefry / gist:a1a3104dade16308cc1eaf82d38efa1d
Created Aug 1, 2017 — forked from shazron/gist:943736
About XCode 4 Project Template (How To Create Custom Project Template)
View gist:a1a3104dade16308cc1eaf82d38efa1d
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
View 十六进制 打印数据
#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) {
@enefry
enefry / nginx_install_script.sh
Last active Sep 12, 2017
nginx install script
View nginx_install_script.sh
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
You can’t perform that action at this time.