Skip to content

Instantly share code, notes, and snippets.

View jan4984's full-sized avatar
🎯
Focusing

JiangYD jan4984

🎯
Focusing
  • moonshot.cn
  • ShangHai
View GitHub Profile
@trevnorris
trevnorris / main.cc
Created February 5, 2016 23:53
Run a callback when an object is GC'd
#include <v8.h>
#include <node.h>
using namespace v8;
typedef void (*FreeCallback)(Local<Object> object, Local<Function> fn);
class CallbackStuff {
public:
@orip
orip / GsonHelper.java
Created September 5, 2012 11:22
Gson type adapter to serialize and deserialize byte arrays in base64
import java.lang.reflect.Type;
import android.util.Base64;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;