This file contains 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) | |
} |
This file contains 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 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 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 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
/** | |
* @author xiaojue | |
* @date 20160420 | |
* @fileoverview 倒计时 | |
*/ | |
(function() { | |
function timer(delay) { | |
this._queue = []; | |
this.stop = false; |
This file contains 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
/* | |
* rem.js | |
* v0.1.1 | |
* fixed 2015-3-12 | |
*/ | |
(function (win){ | |
var doc = win.document, | |
html = doc.documentElement, | |
option = html.getAttribute('data-use-rem'); | |
This file contains 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
/*css reset*/ | |
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;outline:0}html,body,form,fieldset,p,div,h1,h2,h3,h4,h5,h6{-webkit-text-size-adjust:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block;clear:both;} | |
html { font-family: 'Microsoft YaHei',"Helvetica Neue", Helvetica, STHeiTi, Arial, sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; font-size: 62.5%; } | |
body {font-size: 1.4rem;overflow-x: hidden;min-width:320px; /*-webkit-overflow-scrolling: touch;*/color:#1a1a1a;background:#f9f9f9; } | |
a { background: transparent; text-decoration: none; -webkit-tap-highlight-color: transp |
This file contains 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
{ | |
"indent_size": 4, | |
"indent_char": " ", | |
"eol": "\n", | |
"indent_level": 0, | |
"indent_with_tabs": false, | |
"preserve_newlines": true, | |
"max_preserve_newlines": 10, | |
"jslint_happy": false, | |
"space_after_anon_function": false, |
This file contains 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
Show hidden characters
{ | |
// JSHint Default Configuration File (as on JSHint website) | |
// See http://jshint.com/docs/ for more details | |
"maxerr" : 50, // {int} Maximum error before stopping | |
// Enforcing | |
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) | |
"camelcase" : true, // true: Identifiers must be in camelCase | |
"curly" : true, // true: Require {} for every new block or scope |
This file contains 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
var express = require('express') | |
var http = require('http') | |
var net = require('net'); | |
var child = require('child_process'); | |
var app = express(); | |
var httpServer = http.createServer(app); | |
app.get('/', function(req, res) { | |
var date = new Date(); |
NewerOlder