Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View maisui99's full-sized avatar

步天 maisui99

View GitHub Profile
@maisui99
maisui99 / css-to-base64
Last active August 29, 2015 14:01
css images to base64 and fix ie6/7
/**
* Created with IntelliJ IDEA.
* @author: butian.wth
* @version: 1-0-0
* Date: 14-5-27
* Time: 下午5:23
*/
//new Buffer("Hello World").toString('base64')
@maisui99
maisui99 / shake
Created May 20, 2014 03:18
简单的摇一摇实现
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;