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
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>
<html>
<head>
<meta charset="utf-8" />
<title>console track</title>
</head>
<body>
console status: <span id="stat"></span>
<script>
function isConsoleOpen() {
@hiwanz
hiwanz / timer.java
Created Oct 1, 2014
An Android timer demo call
View timer.java
//need to import android.os.Handler;
final Handler h = new Handler();
h.postDelayed(new Runnable()
{
private long time = 0;
@Override
public void run()
{
// do stuff then
@hiwanz
hiwanz / ShakeListener.java
Last active Jul 12, 2016
手机摇一摇类,调用代码: ShakeListener shakeListener = new ShakeListener(this); shakeListener.setOnShakeListener(new ShakeListener.OnShakeListener() { //调用setOnShakeListener方法进行监听,摇晃手机输出信息 public void onShake() { Log.v("debuginfo","shakeing"); } });
View ShakeListener.java
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.