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
1. solution 1 --- add run script | |
TAGS="TODO:|FIXME:|XXX:" | |
echo "searching patch is ${SRCROOT}" | |
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/($TAGS)/ warning: \$1/" | |
2. solution 2 --- by code | |
#define STRINGIFY(S) #S |
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
1. 获取真机 udid | |
1) | |
system_profiler SPUSBDataType | sed -n -e '/iPad/,/Serial/p' -e '/iPhone/,/Serial/p' | grep "Serial Number:" | awk -F ": " '{print $2}' | |
2) | |
system_profiler SPUSBDataType | sed -n -E -e '/(iPhone|iPad)/,/Serial/s/ *Serial Number: *(.+)/\1/p' | |
3) | |
#!/bin/bash |
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
#!/bin/sh | |
### Modified from http://blog.csdn.net/favormm/article/details/6772097 | |
set -xe | |
DEVELOPER=`xcode-select -print-path` | |
DEST=`pwd .`"/opencore-amr-iOS" | |
ARCHS="i386 x86_64 armv7 armv7s arm64" | |
LIBS="libopencore-amrnb.a libopencore-amrwb.a" | |
# Note that AMR-NB is for narrow band http://en.wikipedia.org/wiki/Adaptive_Multi-Rate_audio_codec |
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
post_install do |installer| | |
copy_pods_resources_path = "Pods/Target Support Files/Pods-XXX/Pods-XXX-resources.sh" | |
string_to_replace = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"' | |
assets_compile_with_app_icon_arguments = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${BUILD_DIR}/assetcatalog_generated_info.plist"' | |
text = File.read(copy_pods_resources_path) | |
new_contents = text.gsub(string_to_replace, assets_compile_with_app_icon_arguments) | |
File.open(copy_pods_resources_path, "w") {|file| file.puts new_contents } | |
end | |
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
#!/bin/bash | |
# | |
# 需要安装 Ghostscript,brew install gs | |
# 使用示例 ./pdf2png.sh xx.xcassets | |
# TODO: 递归遍历目录,实现全自动化 | |
if [[ $# < 1 ]]; then | |
echo "Usage:" >&1 | |
echo " convert-assets /assets " >&1 | |
exit 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
NSURLConnection | NSURLSession | |
------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------- | |
NSURLConnectionDelegate connectionShouldUseCredentialStorage: | | |
------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------- | |
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler: | |
| N |
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
#!/bin/sh | |
PROGNAME=$(basename "$0") | |
PROGDIR=$(dirname "$0") | |
usage() | |
{ | |
echo "Usage: $PROGNAME [option] -p path-of-project" | |
echo "" | |
echo "-p Specifyed the path of your project" |
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
#import <Foundation/Foundation.h> | |
@interface NSString (CFXValidateURL) | |
- (BOOL)cfx_validateUrl; | |
- (BOOL)cfx_validateUrl_RegEx; | |
@end |
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
import tinify | |
import os | |
import os.path | |
import sys | |
print "file name:", sys.argv[0] | |
for i in range(1, len(sys.argv)): | |
print "para:", i, sys.argv[i] | |
sourceFilePath = sys.argv[1] # source path |
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
#!/bin/bash | |
currentDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; | |
echo "current path is:"$currentDir; | |
list_alldir(){ | |
for file2 in `ls -a $1` | |
do | |
if [ x"$file2" != x"." -a x"$file2" != x".." ];then |
NewerOlder