Skip to content

Instantly share code, notes, and snippets.

@luhui
luhui / gist:8ffe22c65f26b91cfdf2281194f77fca
Created December 6, 2017 02:08 — forked from libitte/gist:cbde168d26bc5faf9bf9fef648091b42
FIX warning: ignoring broken ref refs/remotes/origin/HEAD

warning: ignoring broken ref refs/remotes/origin/HEAD


➜   ✗ g symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/develop
➜   ✗ g fetch --prune
➜   ✗ g gc

@luhui
luhui / ubuntu14.04-command-line-install-android-sdk
Created September 5, 2017 01:39 — forked from wenzhixin/ubuntu14.04-command-line-install-android-sdk
Ubuntu 14.04 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
@luhui
luhui / 0_reuse_code.js
Created February 16, 2017 07:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@luhui
luhui / upload-to-appstore.sh
Created February 20, 2016 05:27 — forked from jedi4ever/upload-to-appstore.sh
Command upload App/Ipa to the iTunes Connect App Store
#!/bin/bash
set -ex
# This scripts allows you to upload a binary to the iTunes Connect Store and do it for a specific app_id
# Because when you have multiple apps in status for download, xcodebuild upload will complain that multiple apps are in wait status
# Requires application loader to be installed
# See https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html
# Itunes Connect username & password
USER=bla
@luhui
luhui / AutoUploadToFir.sh
Last active February 26, 2022 23:54
an ipa auto upload to fir shell using with jenkins
#!/bin/bash
fir_token="none"
#获取shell文件所在的绝对路径
current_path=$(pwd)
tmp_path=$(dirname $0)
cd $tmp_path
shell_path=$(pwd)
cd $current_path
#参数判断
project_path=
@luhui
luhui / TransformEmailAddress
Created March 3, 2015 01:26
An apple script that transform the email address in contacts
tell application "Contacts"
repeat with i from 1 to (count every person)
set theEmailAddresses to properties of emails of person i
repeat with j from 1 to (count of theEmailAddresses)
if value of item j of theEmailAddresses contains "@cvte.cn" then
set oldAddress to value of item j of theEmailAddresses
set AppleScript's text item delimiters to {"@"}
set firstBit to first text item of oldAddress
set newAddress to firstBit & "@cvte.com"
set value of item j of emails of person i to newAddress
# This script retrieves the git count to build number.
# Instructions:
# Add this file to your project bundle or target.
# Go to Project settings > target > Build Phases > Run Script.
# Add Shell /bin/sh and a value with the bundle path to this script
INFOPLISTPATH="${TARGET_BUILD_DIR}/${EXECUTABLE_NAME}.app/Info.plist"
# Location of PlistBuddy
PLISTBUDDY="/usr/libexec/PlistBuddy"
@luhui
luhui / AutoEnvironmentSetup
Created December 10, 2014 15:49
This script will auto setup the develop environment for iOS developer. Mostly used for a CI Server setup
#!/bin/sh
echo "--------------check if mogenerator is installed----------------------"
isMogeneratorInstalled=0;
if [ -x /usr/local/bin/mogenerator ]; then
isMogeneratorInstalled=1
elif [ -x /usr/bin/mogenerator ]; then
isMogeneratorInstalled=1
fi
if [[ $isMogeneratorInstalled == 0 ]]; then
#!/bin/bash
#使用Mogenerator工具在编译时自动生成/更新对应的core data对象
#see: http://rentzsch.github.io/mogenerator/
#注意!这个脚本不能直接在xcode的run script里调用。需要将脚本直接写在runscript里,否则会提示权限不足.so, please copy the code
# - 替换相应的路径和xxxxx.xcdatamodeld名称
MODELS_DIR="${PROJECT_DIR}/$PROJECT_NAME/Model/CoreData"
DATA_MODEL_PACKAGE="$MODELS_DIR/${ProjectName}.xcdatamodeld/${ProjectName}.xcdatamodel"
if [ -x /usr/local/bin/mogenerator ]; then
echo "mogenerator exists in /usr/local/bin path";
#!/bin/bash
# This script will auto set jpush's configuration for release
# Instructions:
# Add this file to your project bundle or target.
# Go to Project settings > target > Build Phases > Run Script.
# Add Shell /bin/sh and a value with the bundle path to this script
if [ "${CONFIGURATION}" = "Release" ]; then
PLISTBUDDY="/usr/libexec/PlistBuddy"
INFOPLISTPATH="${TARGET_BUILD_DIR}/${EXECUTABLE_NAME}.app/PushConfig.plist"