Skip to content

Instantly share code, notes, and snippets.

@wong2
wong2 / cmds.txt
Last active May 2, 2021 12:13
在任意聊天中输入。 [ ]表示后面要跟一个空格(可能还需要别的参数才能生效)
//wearversion
//wearlog
//wearvoiceinputenable
//wearvoiceinputdisable
//weargoogleapi
//assert
//pushassert
//uplog
//upcrash
//switchnotificationstatus
@mganeko
mganeko / parse_webm.js
Last active April 23, 2022 13:03
Parse Binary of WebM file with Node.js
//
// 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 Bridge API (v1.2.2)

提供与客户端通讯的机制。支持WindVane SDK v2.2 以上版本。

WindVane 独有UA

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"
@wintercn
wintercn / gist:5918272
Created July 3, 2013 14:18
CSS3 标准和属性对应数据
[
{
"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;
};
@fergiemcdowall
fergiemcdowall / LevelDBFileReader.js
Last active January 10, 2022 14:56
A Gist to demonstrate writing and reading image files to LevelDB via the node module level up
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!');
});
})
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
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