Skip to content

Instantly share code, notes, and snippets.

View madeye's full-sized avatar
🚩
Hiring chip architect at NVIDIA Shanghai office.

Max Lv madeye

🚩
Hiring chip architect at NVIDIA Shanghai office.
View GitHub Profile
@nullivex
nullivex / ifb_wondershaper.sh
Created July 13, 2014 18:32
Wondershaper implementation that uses IFB for ingress rate limiting
#!/bin/sh
# Wonder Shaper
# please read the README before filling out these values
#
# Set the following values to somewhat less than your actual download
# and uplink speed. In kilobits. Also set the device that is to be shaped.
# All config needs to be done in /etc/config/wshaper
#. /lib/functions.sh
@mpurbo
mpurbo / android-aar-maven-local.sh
Last active June 14, 2019 06:05
Installing Facebook SDK as aar to local maven repository
export ANDROID_HOME=/Applications/Android\ Studio.app/sdk/
cd facebook-android-sdk-3.14
gradle facebook:build
mv facebook/build/libs/facebook.aar facebook/build/libs/facebook-3.14.aar
mvn install:install-file -Dfile=facebook/build/libs/facebook-3.14.aar -DgroupId=com.facebook -DartifactId=android-sdk -Dversion=3.14 -Dpackaging=aar
@Mons
Mons / ev-ares.c
Created September 22, 2013 11:42
c-ares + libev gcc -lev -lcares async_dns.c
#include <ev.h>
#include <ares.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdarg.h>
@jehiah
jehiah / lru_cache.c
Created April 3, 2011 21:35
a LRU cache in C using uthash
#include <string.h>
#include <uthash.h>
// this is an example of how to do a LRU cache in C using uthash
// http://uthash.sourceforge.net/
// by Jehiah Czebotar 2011 - jehiah@gmail.com
// this code is in the public domain http://unlicense.org/
#define MAX_CACHE_SIZE 100000