Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
#import <Foundation/Foundation.h> | |
#import <objc/objc-runtime.h> | |
static const void *myMsgSend(id receiver, const char *name) { | |
SEL selector = sel_registerName(name); | |
IMP methodIMP = class_getMethodImplementation(object_getClass(receiver), selector); | |
return methodIMP(receiver, selector); | |
} | |
void RunMyMsgSend() { |
#import <Foundation/Foundation.h> | |
#import <objc/objc-runtime.h> | |
void PrintObjectMethods () { | |
unsigned int count = 0; | |
Method *methods = class_copyMethodList([NSObject class], &count); | |
for (unsigned int i = 0; i < count; i++) { | |
SEL sel = method_getName(methods[i]); | |
const char *name = sel_getName(sel); | |
printf("%s\n", name); |
#import <Foundation/Foundation.h> | |
#import <objc/objc-runtime.h> | |
@interface Person : NSObject | |
@property (copy) NSString *givenName; | |
@property (copy) NSString *surname; | |
@end | |
@interface Person () | |
@property (strong) NSMutableDictionary *properties; |
/** | |
* 左旋转字符串 | |
*/ | |
#include <stdio.h> | |
/** | |
* 方案一 | |
*/ | |
void left_shit_one(char *s, int n) { | |
char t = s[0]; |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
void *thread_func(void *arg); | |
int main(void) { | |
int rs; | |
pthread_t thd; |
#include <stdio.h> | |
int checkEndian(void) { | |
union { | |
int i; | |
char ch; | |
}c; | |
c.i = 1; | |
return (c.ch == 1); | |
} |
/* find index of first s1[i] that matches any s2[]. */ | |
size_t czf_strcspn(const char *s1, const char *s2) { | |
const char *sc1, *sc2; | |
for (sc1 = s1; *sc1 != '\0'; ++sc1) { | |
for (sc2 = s2; *sc2 != '\0'; ++sc2) { | |
if (*sc1 == *sc2) | |
return (sc1 - s1); | |
} | |
} | |
return (sc1 - s1); // terminating nulls match. |