Skip to content

Instantly share code, notes, and snippets.

View huandu's full-sized avatar

Huan Du huandu

View GitHub Profile
@huandu
huandu / nginx-cors.conf
Last active July 11, 2020 12:28 — forked from sbuzonas/nginx-cors.conf
Nginx CORS maps
map $http_origin $allow_origin {
default "$http_origin";
}
map $request_method $cors_method {
default "allowed";
"OPTIONS" "preflight";
}
map $cors_method $cors_max_age {
@huandu
huandu / ..build-protbuf-2.5.0.md
Last active August 29, 2015 14:25 — forked from BennettSmith/..build-protbuf-2.5.0.md
Build script for protobuf 2.5.0 on iOS devices

Google Protobuf 2.5.0 - Mac OS X and iOS Support

The script in this gist will help you buid the Google Protobuf library for use with Mac OS X and iOS. Other methods (such as homebrew or direct compilation) have issues that prevent their use. The libraries built by this script are universal and support all iOS device architectures including the simluator.

Get the Script

The easiest way to use this script is to simply clone the gist onto your

#!/bin/bash
set -e
# Setup architectures, library name and other vars + cleanup from previous runs
ARCHS=("armv7" "armv7s" "arm64" "i386" "x86_64")
SDKS=("iphoneos" "iphoneos" "iphoneos" "macosx" "macosx")
LIB_NAME="libevent-2.0.22-stable"
SCRIPT_DIR=$(dirname "$0")
OUTPUT_DIR="${SCRIPT_DIR}/.."
HEADER_DEST_DIR="${OUTPUT_DIR}/include/ios/libevent"