Skip to content

Instantly share code, notes, and snippets.

@onlyyoujack
onlyyoujack / LFAudioMixer.m
Created June 12, 2018 06:55 — forked from olenhad/LFAudioMixer.m
Simple Audio Mixer
//
// LFAudioMixer.m
// Garena
//
// Created by Omer Iqbal on 8/3/17.
// Copyright © 2017 Garena. All rights reserved.
//
#import "LFAudioMixer.h"
#import <AVFoundation/AVFoundation.h>
@onlyyoujack
onlyyoujack / versionMacros.h
Created July 1, 2016 09:34 — forked from mattwymore/versionMacros.h
Macros for comparing iOS Version numbers. See: http://stackoverflow.com/questions/3339722/check-iphone-ios-version for more discussion
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
@onlyyoujack
onlyyoujack / last_commit.py
Created May 17, 2016 14:59 — forked from bitrut/last_commit.py
Get timestamp of the last commit in git repository
#!/usr/bin/python
import subprocess
import re
from optparse import OptionParser
def git_version():
p = subprocess.Popen(["git", "log" , '-1', '--date=iso'], stdout=subprocess.PIPE)
out, err = p.communicate()
m = re.search('\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}', out)
@onlyyoujack
onlyyoujack / version_by_git_commit_number.sh
Created May 17, 2016 10:48 — forked from SuperY/version_by_git_commit_number.sh
编译把Git的提交次数作为小版本号
#Git 版本数
VERSION_NUMBER=`git rev-list head | sort | wc -l | awk '{print $1}'`
#VERSION_HASH=`git rev-list head | head -1`
echo $VERSION_NUMBER
#echo $VERSION_HASH

关于H264, 通用的5个进阶文档为

  • [H.264_MPEG-4 Part 10 White Paper]
  • [Video coding using the H.264 MPEG-4 AVC compression standard]
  • [H.264 and MPEG-4 video compression]
  • [Overview of the H.264_AVC Video Coding Standard]
  • [Overview and Introduction to the Fidelity Range Extensions]

分三个阶段学习

@onlyyoujack
onlyyoujack / gist:4e07994f9df215d75bb4
Created March 23, 2016 08:18 — forked from snikch/gist:3661188
Find the current top view controller for your iOS application
- (UIViewController *)topViewController{
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController];
}
- (UIViewController *)topViewController:(UIViewController *)rootViewController
{
if (rootViewController.presentedViewController == nil) {
return rootViewController;
}
@onlyyoujack
onlyyoujack / UIColorFromRGB.m
Created February 26, 2016 11:50 — forked from FrankWu100/UIColorFromRGB.m
UIColor macro with hex values
// http://stackoverflow.com/a/3532264
// http://cocoamatic.blogspot.tw/2010/07/uicolor-macro-with-hex-values.html
// http://www.touch-code-magazine.com/web-color-to-uicolor-convertor/
//RGB color macro
#define UIColorFromRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
@onlyyoujack
onlyyoujack / Rails Base64 encoded HMAC-SHA1
Created February 18, 2016 01:57 — forked from septerr/Rails Base64 encoded HMAC-SHA1
Base64 encoded HMAC-SHA1 in iOS and Rails
secret = "xxx"
data = "http://someurl?someparams"
hmac = OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), secret.encode("ASCII"), data.encode("ASCII"))
signature = Base64.encode64(hmac).chomp
@onlyyoujack
onlyyoujack / introrx.md
Created February 3, 2016 07:36 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@onlyyoujack
onlyyoujack / String.swift
Created December 15, 2015 06:44 — forked from kharrison/String.swift
Swift String Playground Examples
// Swift Standard Librray - String
// ====
// Initializing a String
// ====
var emptyString = "" // Empty String
var stillEmpty = String() // Another empty String
let helloWorld = "Hello World!" // String inferred