This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof window.DeviceMotionEvent != 'undefined') { | |
// Shake sensitivity (a lower number is more) | |
var sensitivity = 20; | |
// Position variables | |
var x1 = 0, y1 = 0, z1 = 0, x2 = 0, y2 = 0, z2 = 0; | |
// Listen to motion events and update the position | |
window.addEventListener('devicemotion', function (e) { | |
x1 = e.accelerationIncludingGravity.x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created with IntelliJ IDEA. | |
* @author: butian.wth | |
* @version: 1-0-0 | |
* Date: 14-5-27 | |
* Time: 下午5:23 | |
*/ | |
//new Buffer("Hello World").toString('base64') |