Skip to content

Instantly share code, notes, and snippets.

@ksky521
ksky521 / waservice.js
Created August 24, 2018 05:28
微信小程序的 WAService.js
This file has been truncated, but you can view the full file.
;var __WAServiceStartTime__ = Date.now();
(function() {
var __exportGlobal__ = {};
var WeixinJSBridge = function(e) {
"function" == typeof logxx && logxx("jsbridge start");
var t = "undefined" != typeof __devtoolssubcontext && __devtoolssubcontext;
if (e.navigator && e.navigator.userAgent) {
var n = e.navigator.userAgent;
(n.indexOf("appservice") > -1 || n.indexOf("wechatdevtools") > -1) && (t = !0)
}
@ksky521
ksky521 / waservice.js
Created August 24, 2018 05:28
微信小程序的 WAService.js
This file has been truncated, but you can view the full file.
;var __WAServiceStartTime__ = Date.now();
(function() {
var __exportGlobal__ = {};
var WeixinJSBridge = function(e) {
"function" == typeof logxx && logxx("jsbridge start");
var t = "undefined" != typeof __devtoolssubcontext && __devtoolssubcontext;
if (e.navigator && e.navigator.userAgent) {
var n = e.navigator.userAgent;
(n.indexOf("appservice") > -1 || n.indexOf("wechatdevtools") > -1) && (t = !0)
}
@ksky521
ksky521 / cloudSettings
Last active December 23, 2020 07:35
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-12-23T07:35:09.263Z","extensionVersion":"v3.4.3"}
@ksky521
ksky521 / markdownhere.css
Created February 19, 2017 15:21 — forked from xiaolai/markdownhere.css
markdown-here-css
.markdown-here-wrapper {
font-size: 16px;
line-height: 1.8em;
letter-spacing: 0.1em;
}
pre, code {
font-size: 14px;
font-family: Roboto, 'Courier New', Consolas, Inconsolata, Courier, monospace;
@ksky521
ksky521 / puff.js
Created November 15, 2014 13:57
一个canvas做的烟雾效果
var Easing = {
get: function(a, b, c, e, d, f, g) {
return b + Easing[a](Math.min(e, d), d, f, g) * (c - b)
},
getRound: function(a, b, c, e, d, f, g) {
return Math.round(Easing.get(a, b, c, e, d, f, g))
},
easeInQuad: function(a, b) {
return (a /= b) * a
},
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<title>ios调起实验 @三水清</title>
<script src="http://zeptojs.com/zepto.min.js"></script>
<style>
button{
height: 80px;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<title>JS Bin</title>
<script src="http://zeptojs.com/zepto.min.js"></script>
<style>
button{
height: 80px;
@ksky521
ksky521 / gist:5532540
Created May 7, 2013 13:27
使用iweibo,30行代码搞定微博天气机器人
var bdTemplate = require('./baiduTemplate').template;
var iweibo = require('iweibo');//npm install iweibo
var Weibo = iweibo.Weibo;
var access_token = '2.xxxxx';
iweibo.set({
appkey: 'xxxx',
appsecret: 'xxxxx'
});
var weibo = new Weibo(access_token, '');
@ksky521
ksky521 / gist:5519468
Last active December 17, 2015 00:18
MixJS v 0.3.0
(function(window, undefined) {
'use strict';
var document = window.document;
var setTimeout = window.setTimeout;
//本js文件不支持defer等属性,否则计算当前路径会错误
//模块加载的东西,基础js肯定不能defer掉……
var curScriptNode = (function() {
var scripts = document.getElementsByTagName('script');
return scripts[scripts.length - 1]; //FF下可以使用DOC.currentScript
})();
@ksky521
ksky521 / gist:5507311
Created May 3, 2013 05:08
一个简单队列
(function(global) {
var _emptyArr = [];
var _arrSlice = _emptyArr.slice;
/**
* 一个简单队列
* @param {[type]} id [description]
*/