Skip to content

Instantly share code, notes, and snippets.

bumaociyuan / gist:b6fe9ac3378395e28c88
Last active Aug 29, 2015 — forked from palimondo/gist:5998280
Concise Auto Layout macros
View gist:b6fe9ac3378395e28c88
#define Left NSLayoutAttributeLeft
#define Right NSLayoutAttributeRight
#define Top NSLayoutAttributeTop
#define Bottom NSLayoutAttributeBottom
#define Leading NSLayoutAttributeLeading
#define Trailing NSLayoutAttributeTrailing
#define Width NSLayoutAttributeWidth
#define Height NSLayoutAttributeHeight
#define CenterX NSLayoutAttributeCenterX
#define CenterY NSLayoutAttributeCenterY
bumaociyuan /
Last active Sep 23, 2015 — forked from einthusan/
Install Golang 1.4.1 on Ubuntu 14.04 AWS EC2
# -geoip true
# this will install maxmind geoip and auto update crontab file
# -cloudwatch true
# this will install aws cloud watch metrics and send them to aws dashboard
bumaociyuan /
Created Feb 19, 2016 — forked from sekati/
Xcode Auto-increment Build & Version Numbers
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
bumaociyuan /
Last active Feb 19, 2016 — forked from elmodos/
Xcode build number Git revision number
# get GIT revision number
buildNumber=`git rev-list --count HEAD`
# write build number
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${buildNumber}" "${INFOPLIST_FILE}"
# if [ "$CONFIGURATION" == "Release" ]; then
# # version number like this V0.20160109.004
bumaociyuan /
Created Jul 28, 2016 — forked from cromandini/
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures).
# make sure the output directory exists
# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
bumaociyuan /
Last active Sep 30, 2018 — forked from susnmos/
A script for cycript
(function(exports) {
// 打印按钮的action及其target
zxactionWithTargets = function actionWithTargets(button) {
var allTargets = [button allTargets].allObjects();
if (!allTargets) {
return "is not a uicontrol"
var allShow = [];
for (var i = 0; i < allTargets.length; i++) {
var target = allTargets[i];
bumaociyuan / jxaClickAppSubMenuItem.applescript
Last active Dec 2, 2020 — forked from RobTrew/jxaClickAppSubMenuItem.applescript
Yosemite JXA Javascript Function for clicking application sub-menu items
View jxaClickAppSubMenuItem.applescript
// Click an OS X app sub-menu item
// 2nd argument is an array of arbitrary length (exact menu item labels, giving full path)
// e.g. menuItemClick("InqScribe", ['View', 'Aspect Ratio', 'Use Media Ratio'])
// Note that the menu path (spelling & sequence) must be exactly as in the app
// See menuItemTestClick() below for a slower version which reports any errors
// For OS X 10.10 Yosemite JXA JavaScript for Automation