Skip to content

Instantly share code, notes, and snippets.

View wangmuy's full-sized avatar

zdwang wangmuy

View GitHub Profile
@wangmuy
wangmuy / ImageUtil.java
Last active August 30, 2016 09:40
android.graphics.image manipulation utils
// http://pjq.me/wiki/doku.php?id=android:animation
package me.pjq.imageutil;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Rect;
@wangmuy
wangmuy / octopress_search_markdown
Created November 8, 2013 07:37
Octopress instant search using "Jekyll+lunr.js"
---
layout: page
title: "Search"
#date: 2013-11-06 20:27
keywords:
description:
comments: false
sharing: false
footer: false
#published: false
@wangmuy
wangmuy / Android-Reading-List
Last active August 29, 2015 14:05
Android Reading List
入门
==========
[四大组件](http://developer.android.com/guide/components/fundamentals.html)
[Life cycle from d.android.com](http://d.android.com/reference/android/app/Activity.html)
[Life cycle from 'Hello Android'](http://media.pragprog.com/titles/eband3/concepts.pdf)
[Life cycle image](https://github.com/xxv/android-lifecycle/blob/master/complete_android_fragment_lifecycle.png)
[Context分类](http://www.doubleencore.com/2013/06/context/)
[Intent]()
[点9图](http://isux.tencent.com/android-ui-9-png.html)
@wangmuy
wangmuy / svn2mantis.pl
Created May 25, 2015 08:22
svn commit log to close relevant mantis bug
#!/usr/bin/perl
#
# 16:32 2010/10/7
# Jonathan Tsai
# Ver 1.12
#
# 自動將 svn 訊息寫入 mantis 紀錄內
#
# 參考 http://www.ichiayi.com/trywiki/tech/svnmantis 的說明方式
# 本 script 需配合:
@wangmuy
wangmuy / svn2mantis.pl
Created May 25, 2015 08:22
svn commit log to close relevant mantis bug
#!/usr/bin/perl
#
# 16:32 2010/10/7
# Jonathan Tsai
# Ver 1.12
#
# 自動將 svn 訊息寫入 mantis 紀錄內
#
# 參考 http://www.ichiayi.com/trywiki/tech/svnmantis 的說明方式
# 本 script 需配合:
@wangmuy
wangmuy / androidCursorIterate.java
Last active August 30, 2016 09:41
android.provider.Cursor Iterate
void iterate(Context context, Uri uri) {
Cursor c = null;
try {
final ContentResolver resolver = context.getContentResolver();
final String[] prjection = { BaseColumns._ID, PKG_NAME };
c = resolver.query(uri, prjection, null, null, null);
final int pkgColumnId = 0;
while(c.moveToNext()) {
String pkgName = c.getString(imColumn);
// TODO: do something
@wangmuy
wangmuy / svnsync-repo.sh
Last active August 30, 2016 02:14
svnsync
#!/bin/sh
[ -z "$DIR" ] && DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SRC=http://192.168.1.100/svn
cd $DIR
repo=$1
echo repo=$repo
FILE=file://$DIR/$repo
INIT_OK=0
[ ! -d $repo ] && INIT_OK=1 && mkdir -p $repo && \
@wangmuy
wangmuy / sshpass.sh
Last active August 30, 2016 02:16
sshpass supply password in commandline
#!/usr/bin/expect -f
# http://stackoverflow.com/questions/28051969/tcl-expect-equivalent-of-bash-or-how-to-pass-arguments-to-spawned-process-in
# usage:
# sshpass.sh userpwd ssh [email protected] 'nohup sleep 30 </dev/null >/dev/null 2>&1 &'
# sshpass.sh userpwd scp svn-auth-file.bak [email protected]:/home/user/svn-auth-file.bak
set PWD [lindex $argv 0]
set ARGS [lrange $argv 1 end]
spawn {*}$ARGS
expect "*password:*"
@wangmuy
wangmuy / svnsync-revprop.sh
Last active August 30, 2016 02:16
svnsync repo properties
#!/bin/sh
source /etc/profile
[ -z "$DIR" ] && DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SRC=http://192.168.1.100/svn
cd $DIR
repo=$1
rev=$2
echo repo=$repo
FILE=file://$DIR/$repo
@wangmuy
wangmuy / git-bash-portable.bat
Last active August 30, 2016 02:17 — forked from dgw/git-bash-portable.bat
git-bash-portable startup
@echo off
rem Copyright (C): 2010 Voyagerfan5761
rem http://technobabbl.es/
rem Put in your git-for-windows root dir
set USER=wangmuy
set HOMEDRIVE=%~d0
set HOMEPATH=%~dp0home\%USER%\
set HOME=%~dp0home\%USER%\
set USERPROFILE=%HOMEPATH%