Skip to content

Instantly share code, notes, and snippets.

git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@zhangliuliu
zhangliuliu / countrycode.json
Created December 15, 2019 13:27
国际区号JSON
[{"cn":"阿富汗","en":"Afghanistan","phone_code":"+93"},
{"cn":"阿尔巴尼亚","en":"Albania","phone_code":"+355"},
{"cn":"阿尔及利亚","en":"Algeria","phone_code":"+213"},
{"cn":"美属萨摩亚","en":"American Samoa","phone_code":"+684"},
{"cn":"安道尔","en":"Andorra","phone_code":"+376"},
{"cn":"安哥拉","en":"Angola","phone_code":"+244"},
{"cn":"安圭拉","en":"Anguilla","phone_code":"+1264"},
{"cn":"南极洲","en":"Antarctica","phone_code":"+672"},
{"cn":"安提瓜和巴布达","en":"Antigua and Barbuda","phone_code":"+1268"},
{"cn":"阿根廷","en":"Argentina","phone_code":"+54"},
@zhangliuliu
zhangliuliu / new_file0
Last active August 29, 2015 14:21
ChoosePopview
public class ChoosePopview {
private Dialog dialog;
private PopupWindow popup;
private View mArchor;
private PopItemSelector mListener;
private String[] titles;
public ChoosePopview(Context context,String[] titles) {
this.titles = titles;
package com.zll.customview.utils;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.StateListDrawable;
/**
* Created by zhang on 15/5/7.
*/
public class ShapeBuilder {
@zhangliuliu
zhangliuliu / ListView with ViewPager
Created April 8, 2015 03:01
ListView with ViewPager
package com.examples.customtouch;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
@zhangliuliu
zhangliuliu / FlipAnimation
Created March 18, 2015 06:52
FlipAnimation
package yalantis.com.sidemenu.animation;
import android.graphics.Camera;
import android.graphics.Matrix;
import android.util.Log;
import android.view.animation.Animation;
import android.view.animation.Transformation;
public class FlipAnimation extends Animation {
@zhangliuliu
zhangliuliu / new_file0
Created January 4, 2015 03:02
Android——检测TXT文件中是否含有双字节字符
public static boolean isRightfulTXT(File f) {
// TODO Auto-generated method stub
String regexp="[^\\x00-\\xff]";//双字节字符
Pattern p=Pattern.compile(regexp);
try {
FileInputStream fis=new FileInputStream(f);
//"GBK"编码方式支持双字节字符
InputStreamReader isr=new InputStreamReader(fis, "GBK");
BufferedReader br=new BufferedReader(isr);
@zhangliuliu
zhangliuliu / Rich TextView
Created September 5, 2014 08:39
Android Rich TextView
SpannableStringBuilder strContent=new SpannableStringBuilder();
String one="String one test";
String two="String two test";
String three="String three test";
strContent.append(one);
strContent.append(two);
strContent.append(three);
int start=0;
int end=one.length();
strContent.setSpan(new StyleSpan(Typeface.BOLD),start,end, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
@zhangliuliu
zhangliuliu / Uploadlist.java
Last active August 29, 2015 14:06 — forked from keepcleargas/Uploadlist.java
上传列表 参数
public void cPostLocation(Context context, int mtype,
List<DBLocationVO> location,
AsyncHttpResponseHandler responseHandler) {
Util.authCilent(context, client);
int userId = UserInfo.getInstance().getUserId(context);
StringEntity entity = null;
try {
entity = new StringEntity(JSON.toJSONString(location), "UTF8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();