This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQEBAQIBAQECAgICAgQDAgICAgUEBAMEBgUGBgYFBgYGBwkIBgcJBwYGCAsICQoKCgoKBggLDAsKDAkKCgr/2wBDAQICAgICAgUDAwUKBwYHCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgr/wAARCAGgA1IDASIAAhEBAxEB/8QAHQABAAICAwEBAAAAAAAAAAAAAAcIAwYCBQkEAf/EAGQQAAEDAgQCBQYIBwcODAUFAAABAgMEBQYHCBESIQkTFDFBIlFUcZPRMjY4YXV2s7QVFiNCUoGRJDNicnOCoRcYNDc5U3R3kpajsbLTGSUmNUNGVVZXY4PCWWSEwdJlZpXDxP/EAB0BAQABBQEBAQAAAAAAAAAAAAAGAgMEBQcBCAn/xABTEQACAQMCAwQECQcJAwoHAAAAAQIDBBEFIQYSMRNBUWEicYGxBxQyMzRykaGyIzVCUmJzwRU2N0NTdLPR8IKStBYXRUeDhMLE0uEkRGNkk6Lx/9oADAMBAAIRAxEAPwDq+21vpk3tV947bW+mTe1X3mMHA8s/TvC8DJ22t9Mm9qvvHba30yb2q+8xgZYwvAydtrfTJvar7x22t9Mm9qvvMYGWMLwMnba30yb2q+8dtrfTJvar7zGBljC8DJ22t9Mm9qvvHba30yb2q+8xgZYwvAydtrfTJvar7x22t9Mm9qvvMYGWMLwMnba30yb2q+8dtrfTJvar7zGBljC8DJ22t9Mm9qvvHba30yb2q+8xgZYwvAydtrfTJvar7x22t9Mm9qvvMYGWMLwMnba30yb2q+8dtrfTJvar7zGBljC8DJ22t9Mm9qvvHba30yb2q+8xgZYwvAydtrfTJvar7x22t9Mm9qvvMYGWMLwMnba30yb2q+8dtrfTJvar7zGBljC8DJ22t9Mm9qvvHba30yb2q+8xgZYwv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function combine(a) { | |
var fn = function(n, src, got, all) { | |
if (n == 0) { | |
if (got.length > 0) { | |
all[all.length] = got; | |
} | |
return; | |
} | |
for (var j = 0; j < src.length; j++) { | |
fn(n - 1, src.slice(j + 1), got.concat([src[j]]), all); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRandom(n, arr, ret) { | |
ret = ret || []; | |
var randomNum = parseInt(Math.random() * (arr.length - 1), 10); | |
if (ret.indexOf(randomNum) === -1) { | |
ret.push(randomNum); | |
} else { | |
getRandom(n, arr, ret); | |
} | |
return ret.length === n ? ret : getRandom(n, arr, ret); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clipboard2Img(options){ | |
var self = this; | |
this.URL = options.host + options.api; | |
this.success = options.success || function(){}; | |
if(!options.ele){ | |
return alert('options ele must have'); | |
} | |
options.ele.addEventListener('paste', self.getClipboardImage.bind(this), false) | |
} |
OlderNewer