Skip to content

Instantly share code, notes, and snippets.

Avatar
🚗
Hiring chip architect at NVIDIA Shanghai office.

Max Lv madeye

🚗
Hiring chip architect at NVIDIA Shanghai office.
View GitHub Profile
@Mons
Mons / ev-ares.c
Created Sep 22, 2013
c-ares + libev gcc -lev -lcares async_dns.c
View ev-ares.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>
@mpurbo
mpurbo / android-aar-maven-local.sh
Last active Jun 14, 2019
Installing Facebook SDK as aar to local maven repository
View android-aar-maven-local.sh
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
@jehiah
jehiah / lru_cache.c
Created Apr 3, 2011
a LRU cache in C using uthash
View lru_cache.c
#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
@nullivex
nullivex / ifb_wondershaper.sh
Created Jul 13, 2014
Wondershaper implementation that uses IFB for ingress rate limiting
View ifb_wondershaper.sh
#!/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