Skip to content

Instantly share code, notes, and snippets.

View wzpan's full-sized avatar
:octocat:
Focusing

潘伟洲 wzpan

:octocat:
Focusing
View GitHub Profile
@wzpan
wzpan / sign.sh
Created June 12, 2017 03:48
Sign an android app.
# sh sign.sh path_to_apk.apk path_to_key_store.keystore STOREPASSWORD STOREALIAS
rm -rf build
mkdir build
cd build
unzip $1
rm -rf META-INF
APK_NAME=`basename $1`
STORE_PATH=$3
STORE_PASS=$3
STORE_ALIAS=$4
@wzpan
wzpan / README.md
Created May 5, 2017 13:55 — forked from chuangbo/README.md
Python dynamic DNSPod DNS Script

替换上你的Email,密码,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获得domain_id可以用curl curl -k https://dnsapi.cn/Domain.List -d "login_email=xxx&login_password=xxx"

获得record_id类似 curl -k https://dnsapi.cn/Record.List -d "login_email=xxx&login_password=xxx&domain_id=xxx"

@wzpan
wzpan / post-merge
Created April 18, 2016 06:47 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed. In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed. Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@wzpan
wzpan / tag.css
Created March 24, 2016 09:43
StyleSheet for hexo-tag-bootstrap.
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
button {
overflow: visible;
}
button {
@wzpan
wzpan / redmine gitlab sync
Created February 16, 2016 04:01 — forked from jakimowicz/redmine gitlab sync
simple (and dirty) sync between redmine issues and gitlab issues
#!/usr/bin/env ruby
require 'faraday'
require 'json'
require 'gitlab'
module Redmine
Host = nil
APIKey = nil
@wzpan
wzpan / speedup.py
Created June 1, 2015 16:17
A python script to speed up the rendering process of Hexo 3.
#!/usr/bin/python2
'''
SYNOPSIS:
$ python speedup.py -f FILE
or
$ python speedup.py -d DIR
'''
@wzpan
wzpan / HelloWorld.java
Last active August 29, 2015 14:22
Java keyboard IO.
import java.io.*;
class HelloWorld
{
public static void main(String args[])
{
InputStreamReader sin = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(sin);
System.out.println("Type your name: ");
try{
#!/usr/bin/env ruby
if ARGV[0].nil? || ARGV[0].match(/-h/)
puts "Usage : #{$0} github_username dash_sqlite_db char_appended_to_keyword [no_comments]"
exit
end
require 'net/http'
require 'open-uri'
#require 'awesome_print'
#! /bin/bash
# 计算有效变更代码量的脚本
# 包括注释,但不包括新增的空行
version() {
OS=`uname -o`
echo "svn_counter ($OS) 0.0.1"
}
usage() {
@wzpan
wzpan / getopt.py
Last active August 29, 2015 14:05
Python2 example to handle options and arguments.
import sys, os, getopt
TARGET_TYPE = ".log"
def process_file(path):
''' Process a file. '''
print path
def process_dir(path):