Skip to content

Instantly share code, notes, and snippets.

View MeekJeen's full-sized avatar
😀
Out sick

MeekJeen

😀
Out sick
View GitHub Profile
/**
* 用AudioManager获取音频焦点避免音视频声音重叠问题
*/
public class AudioFocusManager {
private static final String TAG = "AudioFocusManager";
private Context mContext;
private AudioManager mAudioManager;
private AudioManager.OnAudioFocusChangeListener mAudioFocusChangeListener;
@EXL
EXL / 1-ReadMe.md
Last active January 13, 2024 06:04
OpenGLES for Linux example
@waveacme
waveacme / logger.c
Created March 25, 2016 02:45
a macro logger for c
#include "logger.h"
int DebugLevel = DEBUG_WARN;
int main(void)
{
DBGPRINT(DEBUG_WARN, ("hello,debug=%s\n", "aaa"));
return 0;
}
@syoyo
syoyo / gist:9acc46554723db14d3a5
Created December 21, 2015 11:44
clang/LLVM for Android ARM64 corss compile script
#!/bin/bash
rm -rf CMake*
export NDK=/home/syoyo/local/android-ndk-r10e
export SYSROOT=$NDK/platforms/android-21/arch-arm64
export CC="$NDK/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-gcc"
export CXX="$NDK/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-g++"
@dashjim
dashjim / main.cpp
Last active June 9, 2021 11:23
WebRTC voe - voice engine - Playout local audio file demo - for Windows - passed for VS 2010
#include <iostream>
#include <locale>
#include <string>
#include "voe_base.h"
#include "voe_codec.h"
#include "voe_volume_control.h"
#include "voe_dtmf.h"
#include "voe_rtp_rtcp.h"
#include "voe_audio_processing.h"
@windwiny
windwiny / gist:c85dd8c2571b4374f874
Last active October 24, 2023 05:55
Linux 基于策略的路由(Linux Policy Routing)(Linux 多个网卡使用相同网段的IP地址设置)
----
Linux 基于策略的路由(Linux Policy Routing)
Linux 有传统的基于数据包目的地址的路由算法,和新的基于策略的路由算法
新算法优点:支持多个路由表,支持按数据报属性(源地址、目的地址、协议、端口、数据包大小、内容等)选择不同路由表
# 查看规则命令,后面可跟其它参数,默认为 show(list) 显示全部
ip rule
@binux
binux / auto_vpn.sh
Created January 16, 2014 14:48
自动添加gfwlist域名的对应ip到路由表,实现动态自动翻墙
#!/bin/sh
while :
do
dev=$(ip link | grep state | awk '{ sub(":", "", $2); print $2 }' | grep vpn)
if [ $? -ne 0 ]; then
sleep 5
continue
fi
break
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs