Skip to content

Instantly share code, notes, and snippets.

@robinma
robinma / draw_svg.js
Created January 9, 2017 10:14 — forked from shamansir/draw_svg.js
draw SVG path on canvas
// take SVG commands and draw this path to HTML5 canvas
// commandList should look like that: [ { marker: "M", values: [ 10, 10 ] },
// { marker: "l", values: [ 5, 7 ] },
// { marker: "C", values: [ -5, 7.2, .3, -16, 24, 10 ] },
// . . .
// { marker: "z", values: [ ] } ]
// there's another gist which has the code to parse SVG paths:
// https://gist.github.com/shamansir/0ba30dc262d54d04cd7f79e03b281505
@robinma
robinma / gist:dd2a857df2385bf3207d
Last active August 29, 2015 14:06
imagelazyloader 代码阅读笔记

##imagelazyloader##

maxzhang

图片延迟加载 阅读代码笔记

 //闭包,默认传入为window,参数变量名又为window,可以改为其它关键字
 (function(window) {

//判断是否android系统,主要为后面是否有动画的判断量

@robinma
robinma / videoajax.md
Last active August 29, 2015 14:06
视频数据交互接口

#视频数据交互接口#

##一,简介##

以下为视频数据ajax交互接口

##二,How to use##

###2.1 init to###

@robinma
robinma / lotter code
Created August 20, 2014 11:57
抽奖代码片断
/**
* @author jerry
*/
var turnplate=(function(){
var turnplate = {
turnplateBox : '',
turnplateBtn : '',
lightDom : '',
initBoxEle : '',
"use strict"
var Promise = function () {
this.state = 'pending'
this.thenables = []
}
Promise.prototype.resolve = function (value) {
if (this.state != 'pending') return
this.state = 'fulfilled'