Skip to content

Instantly share code, notes, and snippets.

View zhaoxiaobao's full-sized avatar
🤒
Out sick

zhaoyuan zhaoxiaobao

🤒
Out sick
View GitHub Profile
@zhaoxiaobao
zhaoxiaobao / gist:96f2c89ced46a7e57e363f25f8d6a840
Created May 8, 2016 12:41
UIButton - 避免多次重复点击
#import <UIKit/UIKit.h>
@interface UIButton (antiMultiplyTouch)
- (void)antiMultiplyTouch:(NSTimeInterval)delay block:(void(^)(void))operation;
@end
== .m文件
#import "UIButton+AntiMultiplyTouch.h"
@zhaoxiaobao
zhaoxiaobao / code for happiness
Created May 23, 2016 12:28
脚本统计oc代码行数
find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" -or -name "*.rss" ")" -print | xargs wc -l
@zhaoxiaobao
zhaoxiaobao / stackoverflow-tag-objective-c-1
Created June 16, 2016 13:24
stackoverflow-tag-objective-c
1.How do I convert an NSString value to NSData?
NSString* str = @"teststring";
NSData* data = [str dataUsingEncoding:NSUTF8StringEncoding];
2.How to check iOS version?
[[UIDevice currentDevice].systemVersion floatValue]
3.How do I create delegates in Objective-C?
http://stackoverflow.com/questions/626898/how-do-i-create-delegates-in-objective-c
@zhaoxiaobao
zhaoxiaobao / objective-c-2
Created June 16, 2016 15:06
stackoverflow-tag-objective-c-2
1.UIRefreshControl without UITableViewController?
http://stackoverflow.com/questions/12497940/uirefreshcontrol-without-uitableviewcontroller
http://stackoverflow.com/questions/10291537/pull-to-refresh-uitableview-without-uitableviewcontroller?lq=1
2.UITableView - scroll to the top?
http://stackoverflow.com/questions/724892/uitableview-scroll-to-the-top
3.How to disable back swipe gesture in UINavigationController on iOS 7?
http://stackoverflow.com/questions/17209468/how-to-disable-back-swipe-gesture-in-uinavigationcontroller-on-ios-7
@zhaoxiaobao
zhaoxiaobao / Some-Animation-List
Created June 24, 2016 16:08
部分动画代码片段
1.http://stackoverflow.com/questions/7787494/adding-bounce-effect-to-appearance-of-uiimageview
2.http://stackoverflow.com/questions/20637140/animation-slows-down-as-it-ends/20637179#20637179
@zhaoxiaobao
zhaoxiaobao / ffmpeg.md
Created July 27, 2016 08:32 — forked from v5tech/ffmpeg.md
ffmpeg视频合并、格式转换、截图

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"
@zhaoxiaobao
zhaoxiaobao / gist:6322b0fb2fdc8467100284df4bf31253
Created August 23, 2016 08:14
LFLiveKit中VideoToolbox进行硬编代码
static void VideoCompressonOutputCallback(void *VTref, void *VTFrameRef, OSStatus status, VTEncodeInfoFlags infoFlags, CMSampleBufferRef sampleBuffer)
{
if(!sampleBuffer) return;
CFArrayRef array = CMSampleBufferGetSampleAttachmentsArray(sampleBuffer, true);
if(!array) return;
CFDictionaryRef dic = (CFDictionaryRef)CFArrayGetValueAtIndex(array, 0);
if(!dic) return;
BOOL keyframe = !CFDictionaryContainsKey(dic, kCMSampleAttachmentKey_NotSync);
uint64_t timeStamp = [((__bridge_transfer NSNumber*)VTFrameRef) longLongValue];
@zhaoxiaobao
zhaoxiaobao / ff_ffplay_def.h
Created August 29, 2016 04:51
ff_ffplay_def.h
/*
* Copyright (c) 2003 Fabrice Bellard
* Copyright (c) 2013-2015 Zhang Rui <[email protected]>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
@zhaoxiaobao
zhaoxiaobao / index.html
Created October 11, 2016 03:22 — forked from k4ml/index.html
PHP SSE Demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<script>
var source = new EventSource('updates.php');
source.onmessage = function(e) {
var updates;
@import "mixins.less";
// Prefix
@che300-prefix : che300;
@che300-prefix-css :~"@{che300-prefix}-css";
@che300-prefix-btn :~"@{che300-prefix}-btn";
@che300-prefix-tag :~"@{che300-prefix}-tag";
@che300-prefix-pricing :~"@{che300-prefix}-pricing";
// Color
@primary-color : #f6f7fb;