Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

丸子 hiwanz

I may be slow to respond.
Block or report user

Report or block hiwanz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
hiwanz / detect-console.html
Created Nov 19, 2014
Detect if browser console is opened.(Chrome 38.0.2125.111 m,IE 11 is tested)
View detect-console.html
<!doctype html>
<meta charset="utf-8" />
<title>console track</title>
console status: <span id="stat"></span>
function isConsoleOpen() {
hiwanz /
Created Oct 1, 2014
An Android timer demo call
//need to import android.os.Handler;
final Handler h = new Handler();
h.postDelayed(new Runnable()
private long time = 0;
public void run()
// do stuff then
hiwanz /
Last active Jul 12, 2016
手机摇一摇类,调用代码: ShakeListener shakeListener = new ShakeListener(this); shakeListener.setOnShakeListener(new ShakeListener.OnShakeListener() { //调用setOnShakeListener方法进行监听,摇晃手机输出信息 public void onShake() { Log.v("debuginfo","shakeing"); } });
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
public class ShakeListener implements SensorEventListener {
private static final int SPEED_SHRESHOLD = 2500;
You can’t perform that action at this time.