This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set LC_CTYPE | |
echo 'LC_CTYPE="en_US.UTF-8"' >> /etc/default/locale | |
source /etc/default/locale | |
# Install docker | |
apt-get update | |
apt-get install apt-transport-https ca-certificates | |
apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | tee /etc/apt/sources.list.d/docker.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding=utf-8 -*- | |
import requests | |
import re | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf8') | |
signin='http://v2ex.com/signin' | |
home='http://v2ex.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="2207/*", MODE="0666" | |
# Acer | |
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666", GROUP="plugdev" | |
# ASUS | |
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="plugdev" | |
# Dell | |
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666", GROUP="plugdev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse | |
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse | |
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse | |
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse | |
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse | |
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse | |
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse | |
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse | |
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse | |
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.*; | |
import java.util.Scanner; | |
/** | |
* Print all features of a class | |
* Created by albert on 2016/3/31. | |
*/ | |
public class ClassChecker { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Download books from www.guoxue123.cn | |
* usage: node downloader.js <index page> | |
* example: node downloader.js www.guoxue123.cn/xiaosuo/jd/jpshz/index.htm | |
*/ | |
var http = require('http'); | |
var url = require('url'); | |
var parser = require('cheerio'); | |
var iconv = require('iconv').Iconv('GBK', 'UTF-8'); | |
var fs = require('fs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
email = [email protected] | |
name = ishitcno1 | |
[alias] | |
aa = add -A | |
b = branch | |
l = log | |
mm = commit -m | |
ma = commit --amend | |
s = status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.content.res.Resources; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.Path; | |
import android.graphics.Point; | |
import android.graphics.Rect; | |
import android.graphics.RectF; | |
import android.graphics.SweepGradient; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var os = require('os'); | |
var ip = '127.0.0.1'; | |
os.networkInterfaces().wlan0.forEach(function(ni) { | |
if (ni.family === 'IPv4') | |
ip = ni.address; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DisplayMetrics displaymetrics = new DisplayMetrics(); | |
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); | |
int height = displaymetrics.heightPixels; | |
int width = displaymetrics.widthPixels; |
NewerOlder