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
#!/usr/bin/env lua | |
-- http://www.jianshu.com/p/92a041b1b825 | |
obj_tbl = {} -- {[3]={file, module}} | |
syb_tbl = {} -- {[3]=47} | |
filter_tbl = nil -- {'Test.o'} | |
appname = nil | |
function process_object(line) |
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
static int counter; | |
static long counter_ms; | |
struct timeval time; | |
long now; | |
if (counter == 0) { | |
counter = 1; | |
gettimeofday(&time, NULL); | |
counter_ms = (time.tv_sec * 1000) + (time.tv_usec / 1000); | |
} else if (counter > 100) { | |
gettimeofday(&time, NULL); |
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
#通用iOS工程静态库编译脚本 | |
BUILD_PROJ=$1 | |
BUILD_TARGET=$2 | |
BUILD_OUTPUT=$3 | |
BUILD_CONFIGURATION=$4 | |
BUILD_BIN=xcodebuild | |
#获取SDK编译版本 | |
BUILD_SDK_VERSION=$(${BUILD_BIN} -showsdks | grep iphoneos | sort -r | head -n 1 | grep -o '.\{4\}$') | |
if [[ ${BUILD_SDK_VERSION} = "" ]]; then | |
echo "Error: No iPhone SDK ..." |
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
diff --git a/libavutil/file_open.c b/libavutil/file_open.c | |
index 34070d933b..f96bdf11ac 100644 | |
--- a/libavutil/file_open.c | |
+++ b/libavutil/file_open.c | |
@@ -28,6 +28,9 @@ | |
#if HAVE_IO_H | |
#include <io.h> | |
#endif | |
+#if defined(__APPLE__) | |
+#include <CoreFoundation/CoreFoundation.h> |
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
// | |
// AVAsset+VideoOrientation.h | |
// | |
// Created by Luca Bernardi on 19/09/12. | |
// Copyright (c) 2012 Luca Bernardi. All rights reserved. | |
// | |
#import <AVFoundation/AVFoundation.h> | |
typedef enum { | |
LBVideoOrientationUp, //Device starts recording in Portrait |
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
alias pbecho='echo -e "`pbpaste`"' |
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
static char *url_escape(char *path, int len) { | |
char *org_path = strdup(path); | |
memset(path, 0, len); | |
char *enc = path; | |
for (char *s = org_path; *s && (enc - path < len - 3); s++) { | |
if (strchr("!*'();:@&=+$,/?%%#[]", *s) != NULL) { | |
sprintf(enc, "%%%02X", *s); | |
} else { | |
sprintf(enc, "%c", *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
function varint_decode(...) | |
t = 0 | |
l = 0 | |
for _, i in ipairs{...} do | |
t = t*128 + bit32.extract(i, 0, 7) | |
l = l + 1 | |
if bit32.btest(i, 7) == false then | |
break | |
end | |
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
// create by annidy | |
// 2016-05-13 | |
#include <stdio.h> | |
#include <utlist.h> | |
#include <string.h> | |
#include <stdlib.h> | |
struct TreeNode { | |
int val; | |
struct TreeNode *left; |