Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

fengxing annidy

I may be slow to respond.
Block or report user

Report or block annidy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
annidy / textHeight.m
Created May 22, 2019 — forked from brennanMKE/textHeight.m
Text Height in Objective-C for NSString and NSAttributedString
View textHeight.m
- (CGFloat)heightForAttributedString:(NSAttributedString *)text maxWidth:(CGFloat)maxWidth {
if ([text isKindOfClass:[NSString class]] && !text.length) {
// no text means no height
return 0;
NSStringDrawingOptions options = NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading;
CGSize size = [text boundingRectWithSize:CGSizeMake(maxWidth, CGFLOAT_MAX) options:options context:nil].size;
View Python3 HTTP
import time
from http.server import BaseHTTPRequestHandler, HTTPServer
HOST_NAME = 'localhost'
class MyHandler(BaseHTTPRequestHandler):
def do_HEAD(self):
annidy /
Last active Sep 14, 2018
fast svn checkout
svn co --depth immediates $SvnSource $TargetDir
svn up --depth immediates $TargetDir/module
svn up --set-depth infinity $TargetDir/module/cpp
svn up --set-depth infinity $TargetDir/module/ios
svn up --depth immediates $TargetDir/project/ios
annidy / fps.c
Created Mar 16, 2018
View fps.c
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);
set -x
rm -rf libs
ABIS=(armeabi armeabi-v7a arm64-v8a)
# @see
annidy /
Last active Mar 6, 2018
general build
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 ..."
annidy / patch.diff
Created Aug 15, 2017
patch for FFmpeg cache on iOS
View patch.diff
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 @@
#include <io.h>
+#if defined(__APPLE__)
+#include <CoreFoundation/CoreFoundation.h>
annidy / AVAsset+VideoOrientation.h
Created Apr 25, 2017 — forked from lukabernardi/AVAsset+VideoOrientation.h
Find the video orientation of an AVAsset. (Useful if you need to send the video to a remote server)
View AVAsset+VideoOrientation.h
// 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
annidy / ctags.setup
Last active Mar 13, 2017 — forked from nazgob/ctags.setup
ctags setup on mac
View ctags.setup
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log -f .tags *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
annidy /
Created Mar 7, 2017
echo unicode paste board
alias pbecho='echo -e "`pbpaste`"'
You can’t perform that action at this time.