提供与客户端通讯的机制。支持WindVane SDK v2.2 以上版本。
windvane 在客户端中,会将原始UA后面跟上 WindVane/WindVaneSDK的版本号,你可以通过判断UA的方式来检查环境 其中,淘宝主客户端1212版本(IOS 3.4.5 ANDROID 3.9.5)后格式为
//wearversion | |
//wearlog | |
//wearvoiceinputenable | |
//wearvoiceinputdisable | |
//weargoogleapi | |
//assert | |
//pushassert | |
//uplog | |
//upcrash | |
//switchnotificationstatus |
// | |
// This code parses binary format of WebM file. | |
// recognizes only some important TAGs | |
// | |
// Limitation: | |
// This programs reads all binary at once in memory (100MB). | |
// It is very bad imprementation, but it is still enough for some small WebM file. | |
// | |
// Usage: | |
// node parse_webm.js filename |
var $ = document.querySelectorAll.bind(document); | |
Element.prototype.on = Element.prototype.addEventListener; | |
$('#somelink')[0].on('touchstart', handleTouch); |
提供与客户端通讯的机制。支持WindVane SDK v2.2 以上版本。
windvane 在客户端中,会将原始UA后面跟上 WindVane/WindVaneSDK的版本号,你可以通过判断UA的方式来检查环境 其中,淘宝主客户端1212版本(IOS 3.4.5 ANDROID 3.9.5)后格式为
[ | |
{ | |
name:"HTML5", | |
uri:"http://www.w3.org/TR/html5/single-page.html", | |
category:"markup" | |
}, | |
{ | |
name:"HTML 5.1", | |
uri:"http://www.w3.org/TR/html51/single-page.html", | |
category:"markup" |
[ | |
{ | |
"spec name": "CSS Animations", | |
"uri": "http://www.w3.org/TR/css3-animations", | |
"category": "css-property", | |
"Name": "animation-name", | |
"Value": "<single-animation-name> [\n ‘,’ <single-animation-name> ]*", | |
"Initial": "‘none’", | |
"Applies To": "all elements, ::before and ::after pseudo-elements", | |
"Inherited": "no", |
/** | |
* Hide the addressbar on ios & android devices | |
* https://gist.github.com/yckart/5609969 | |
* | |
* Based on the work from Nate Smith | |
* @see https://gist.github.com/nateps/1172490 | |
* | |
* Copyright (c) 2013 Yannick Albert (http://yckart.com) | |
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php). | |
* 2013/07/10 |
var APP = APP || {}; | |
APP.EventBus = {}; | |
APP.EventBus.bind = function (ev, callback, context) { | |
var calls = this._callbacks || (this._callbacks = {}); | |
var list = calls[ev] || (calls[ev] = []); | |
list.push([callback, context]); | |
return this; | |
}; |
var levelup = require('levelup') | |
var fs = require('fs'); | |
var db = levelup('./imagedb') | |
db.put('name', fs.readFileSync('image.png'), { encoding: 'binary' }, function (err) { | |
db.get('name', { encoding: 'binary' }, function (err, value) { | |
fs.writeFile('image-copy.png', value, function (err) { | |
console.log('image-copy.png saved!'); | |
}); | |
}) |
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |