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 getRandomColor = function () { | |
var str = '#' | |
for (var i = 0; i < 6; i++) { | |
str += '0123456789abcdef' [Math.floor(Math.random() * 16)] | |
} | |
return str | |
} |
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
Array.prototype.last = function () { | |
return this[this.length - 1] | |
} |
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
// http://eslint.org/docs/user-guide/configuring | |
module.exports = { | |
root: true, | |
env: { | |
browser: true, | |
}, | |
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style | |
extends: 'standard', | |
extends: 'vue', |
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
#!/bin/bash | |
# author: koumm | |
# desc: auto vsftpd script | |
# date: 2010-07-30 | |
# version: v1.1 | |
# modify: | |
WEBROOT="/data1/htdocs/www.koumm.com" | |
FTP_PORT="3000" |
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
/** | |
** 加法函数,用来得到精确的加法结果 | |
** 说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。 | |
** 调用:accAdd(arg1,arg2) | |
** 返回值:arg1加上arg2的精确结果 | |
**/ | |
function accAdd(arg1, arg2) { | |
var r1, r2, m, c; | |
try { | |
r1 = arg1.toString().split(".")[1].length; |
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
test{ | |
func changeOrientation(){ | |
guard let slf = self else { | |
return | |
} | |
let isPortrait=slf.isScreenPortrait() | |
print("isPortrait===>"+String(isPortrait)) | |
let isPortrait=slf.isScreenPortrait() | |
print("isPortrait===>"+String(isPortrait)) | |
if isPortrait { |
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 clock(func,times,timeout){ | |
if(!timeout||parseInt(timeout)===NaN){ | |
timeout=100; | |
} | |
var _counter=0; | |
function _(){ | |
func(); | |
_counter++; | |
if(_counter<times){ | |
setTimeout(function(){ |
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
# Logs | |
logs | |
*.log | |
npm-debug.log* | |
yarn-debug.log* | |
yarn-error.log* | |
lerna-debug.log* | |
# Diagnostic reports (https://nodejs.org/api/report.html) |
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
node_modules/ | |
dist | |
build | |
# webstorm | |
.idea |
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
/** | |
* 屏幕长时间无操作执行相应操作(回到首页等) | |
* @param callback | |
* @param millisecond | |
*/ | |
function hasOperate(callback, millisecond) { | |
var timer; |