Skip to content

Instantly share code, notes, and snippets.

View lgyjg's full-sized avatar
🎯
Focusing

JianGuo Yang lgyjg

🎯
Focusing
View GitHub Profile
@lgyjg
lgyjg / CameraStreamConfigurations.java
Last active August 17, 2018 13:03
get CustomStreamConfigurationMap with a custom CameraCharacteristics Key
package com.example.util;
import android.annotation.SuppressLint;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.params.StreamConfigurationMap;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@mayufo
mayufo / 验证中国身份证 前6位对应地区码
Created January 16, 2018 10:12
验证中国身份证 前6位对应地区码
var GB2260 = {
"110000": "北京市",
"110100": "北京市市辖区",
"110101": "北京市东城区",
"110102": "北京市西城区",
"110103": "北京市崇文区",
"110104": "北京市宣武区",
"110105": "北京市朝阳区",
"110106": "北京市丰台区",
"110107": "北京市石景山区",
@NikitaKozlov
NikitaKozlov / generator.py
Last active October 17, 2021 15:20
Simple Java class generator
import sys, os, shutil
def generateClass(directory, classNumber, methodsPerClass, mainPackage):
className = "Foo" + str(classNumber)
filePath = os.path.join(directory, className + ".java")
with open(filePath,"w+") as f:
f.write("package " + mainPackage + "." + directory + ";\n")
f.write("public class " + className + " {\n")
for i in xrange(0, methodsPerClass):
f.write("public void foo" + str(i) + "(){\n")