Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

fengxing annidy

💭
I may be slow to respond.
View GitHub Profile
@trawor
trawor / turbo-qiniu.sh
Last active May 19, 2019
本脚本解决部分地区七牛上传速度慢的问题
View turbo-qiniu.sh
#!/bin/bash
#
# 通过对比 ping 响应时间,找到本机最快的上传ip
# Travis@fir.im
#
# 使用方法:
# sh -c "$(curl -sSL https://gist.githubusercontent.com/trawor/5dda140dee86836b8e60/raw/turbo-qiniu.sh)"
echo "# 这个脚本理论上可以帮你获取任意域名的最快速的IP"
echo "# 获取IP列表的服务由 17ce.com 提供, 非常感谢有这么好的免费服务!"
@syzdek
syzdek / cli-nsrunloop.m
Created Jul 31, 2012
Creating an NSRunLoop for a command line utility.
View cli-nsrunloop.m
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
NSRunLoop * runLoop;
CLIMain * main; // replace with desired class
@autoreleasepool
{
// create run loop
@roxlu
roxlu / YUV420PGrabber.cpp
Created Jul 2, 2013
OpenGL RGB > YUV420P shader/class (doesn't do much more. implementation/usage is up to you)
View YUV420PGrabber.cpp
#include <assert.h>
#include <roxlu/core/Utils.h>
#include <roxlu/core/Log.h>
#include "YUV420PGrabber.h"
YUV420PGrabber::YUV420PGrabber()
:y_prog(0)
,y_vert(0)
,y_frag(0)
,uv_prog(0)
@niw
niw / how_to_extract_dylib_from_shared_cache.md
Last active May 4, 2020
How to extract dylib from shared cache
View how_to_extract_dylib_from_shared_cache.md

How to extract dylib from shared cache

To understand iOS behaviors, sometimes it’s important to disassemble iOS framework binaries.

Since recent iOS firmware, known as .ipsw file, contains non-encrypted root image, it’s easy to access these binaries. However, each framework binaries, dylib files, are placed in a shared cache file.

Thus, before disassembling it, we need to extract the one from the cache.

@nazgob
nazgob / ctags.setup
Created Jan 6, 2012
ctags setup on mac
View ctags.setup
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
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"
@fousa
fousa / FairPlayer.swift
Last active Jul 14, 2020
Integrate HLS with FairPlay.
View FairPlayer.swift
class FairPlayer: AVPlayer {
private let queue = DispatchQueue(label: "com.icapps.fairplay.queue")
func play(asset: AVURLAsset) {
// Set the resource loader delegate to this class. The `resourceLoader`'s delegate will be
// triggered when FairPlay handling is required.
asset.resourceLoader.setDelegate(self, queue: queue)
// Load the asset in the player.
You can’t perform that action at this time.