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 / objectFinder.h
Last active December 29, 2016 15:49
CV - Backprojecting a histogram.
#if !defined OFINDER
#define OFINDER
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
class ObjectFinder {
private:
@wzpan
wzpan / linefinder.h
Last active December 29, 2016 15:49
CV - Detect lines using Hough transform.
/*------------------------------------------------------------------------------------------*\
This file contains material supporting chapter 7 of the cookbook:
Computer Vision Programming using the OpenCV Library.
by Robert Laganiere, Packt Publishing, 2011.
This program is free software; permission is hereby granted to use, copy, modify,
and distribute this source code, or portions thereof, for any purpose, without fee,
subject to the restriction that the copyright notice may not be removed
or altered from any source or altered source distribution.
The software is released on an as-is basis and without any warranties of any kind.
@wzpan
wzpan / shutdown_dialog.sh
Last active August 21, 2016 12:55
A GUI Shutdown dialog.
#!/bin/sh
ACTION=`zenity --width=90 --height=200 --list --radiolist --text="Select logout action" --title="Logout" --column "Choice" --column "Action" TRUE Shutdown FALSE Reboot FALSE LockScreen FALSE Suspend`
if [ -n "${ACTION}" ];then
case $ACTION in
Shutdown)
zenity --question --text "Are you sure you want to halt?" && gksudo halt
## or via ConsoleKit
# dbus-send --system --dest=org.freedesktop.ConsoleKit.Manager
@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 / hexo_draft.py
Last active January 1, 2016 21:39
Help me create a draft for hexo.
#!/bin/python3
import sys
import os
import time
import subprocess
def write(layout, title, current, category, target):
yaml = '''\
title: {1}
@wzpan
wzpan / mnote
Last active December 30, 2015 12:09
Yassnipet for mnote.
# name: margin-note
# key: mnote
# --
{% mnote ${2:index} %} ${1:text} {% endmnote %}$0
@wzpan
wzpan / margin-note.ejs
Last active December 30, 2015 12:09
Example for using margin-note.
{% mnote index %}
Margin note string
{% endmnote %}