Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Gemini Wen geminiwen

🎯
Focusing
View GitHub Profile
View Main.java
package com.gemini.demo;
public class Main {
public static void main(String[] args) {
// write your code here
TreeNode root = new TreeNode();
root.setColor(TreeNode.COLOR_BLACK);
root.setData(50);
View JSONUtil.java
package com.segmentfault.app.utils.json;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.annotation.JSONField;
import org.json.JSONObject;
import java.lang.reflect.Field;
import java.util.Iterator;
View NestedScrollSwipeRefreshLayout.java
package com.segmentfault.app.view;
import android.content.Context;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.NestedScrollingChild;
import android.support.v4.view.NestedScrollingChildHelper;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;
import android.view.MotionEvent;
View ScalableImageView.java
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.support.v4.view.MotionEventCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ImageView;
/**
View simple-template-engine.js
var fs = require("fs");
var fd = fs.openSync("template.html","r");
fs.readFile("template.html", {encoding:"utf-8"},function(err,data){
if(err) {
console.err("error in open file with:" + err);
return;
}
data = data.replace(/\n/g, '\\n')
.replace(/<%=([\s\S]+?)%>/,function(match,code){
return "' + " + code + " + '";
@geminiwen
geminiwen / function_in_js.js
Last active Dec 24, 2015
Function Object in js
View function_in_js.js
var a = function() {
};
var e = [];
e[0] = a;
e[1] = function() {
};
console.log(a == e[1]);
View terminal_emulator_demo.c
#define _XOPEN_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#define BUFSIZE 1024
int main()
You can’t perform that action at this time.