Skip to content

Instantly share code, notes, and snippets.

@zorroyueng
zorroyueng / RoundConnerViewGroup.java
Last active September 4, 2019 12:37
Clip a layout with round conner
/**
* 创建一个圆角的Layout, 且不影响该Layout的background
*/
public class RoundConnerViewGroup extends ViewGroup {
private Path path;
private static final CONNER_RADIUS = <whatever_you_want>;
@Override
@zorroyueng
zorroyueng / python_update.sh
Last active October 25, 2016 09:06
python_update.sh
#!/bin/bash
#auto install python2.7.8 to /usr/local directory!
#and install some libs for python.
#for Centos6.5
#owner:rocky
#date:2015.01.26
#
#mkdir for python software.
#!/bin/bash
#This is a script to initialize the centos7 system,just for my flavor,you can modifiy it according your need.
#install epel-release and update.
yum install epel-release -y && yum update -y
#install/update some basic software.
yum install gcc gcc gcc-c++ make autoconf openssl-devel bison patch unzip ncurses-devel axel
#disable selinux
@zorroyueng
zorroyueng / bobp-python.md
Created October 18, 2016 08:30 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@zorroyueng
zorroyueng / git_toturial
Created August 9, 2016 11:11 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "[email protected]" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://[email protected]/VT.git # clone远程仓库
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@zorroyueng
zorroyueng / include_list_viewpager.xml
Created November 5, 2015 10:48 — forked from iPaulPro/include_list_viewpager.xml
CollapsingToolbarLayout with TabLayout
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
import android.content.Context;
import android.os.Debug;
import java.io.File;
public class OomExceptionHandler implements Thread.UncaughtExceptionHandler {
private static final String FILENAME = "out-of-memory.hprof";
public static void install(Context context) {
Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler();