#参考资料
###下载单个文件,默认将输出打印到标准输出中(STDOUT)中
curl http://www.centos.org
// 判断当前访问者的客户端设备类型、操作系统及浏览器类型 | |
function jupmBrowserType() { | |
var browser = { | |
versions: function () { | |
var u = navigator.userAgent, app = navigator.appVersion; | |
return { // 客户端浏览器版本信息 | |
trident: u.indexOf('Trident') > -1, // IE内核 | |
webKit: u.indexOf('AppleWebKit') > -1, // 苹果、谷歌内核 | |
mobile: !!u.match(/AppleWebKit.*Mobile.*/), // 是否为移动终端 | |
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, // android终端或者uc浏览器 |
#参考资料
###下载单个文件,默认将输出打印到标准输出中(STDOUT)中
curl http://www.centos.org
var lastTime = 0; | |
var prefixes = 'webkit moz ms o'.split(' '); //各浏览器前缀 | |
var requestAnimationFrame = window.requestAnimationFrame; | |
var cancelAnimationFrame = window.cancelAnimationFrame; | |
var prefix; | |
//通过遍历各浏览器前缀,来得到requestAnimationFrame和cancelAnimationFrame在当前浏览器的实现形式 | |
for( var i = 0; i < prefixes.length; i++ ) { | |
if ( requestAnimationFrame && cancelAnimationFrame ) { |
/** | |
* 判断浏览器是否支持某一个CSS3属性 | |
* @param {String} 属性名称 | |
* @return {Boolean} true/false | |
* @version 1.0 | |
*/ | |
function supportCss3(style) { | |
var prefix = ['webkit', 'Moz', 'ms', 'o'], | |
i, |
function Middleware() { | |
this.cache = []; | |
this.options = null; // 缓存options | |
} | |
Middleware.prototype.use = function (fn) { | |
if (typeof fn !== 'function') { | |
throw 'middleware must be a function'; | |
} | |
this.cache.push(fn); |
{ | |
// The plugin looks for a .jsbeautifyrc file in the same directory as the | |
// source file you're prettifying (or any directory above if it doesn't exist, | |
// or in your home folder if everything else fails) and uses those options | |
// along the default ones. | |
// Details: https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options | |
// Documentation: https://github.com/einars/js-beautify/ | |
"html": { | |
"allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg"], |
#!/usr/bin/env bash | |
set -x | |
# Clear Application Saved States JetBrains | |
rm -rfv ~/Library/Saved\ Application\ State/com.jetbrains.* | |
# PhpStorm | |
rm -fv /usr/local/bin/pstorm | |
rm -rfv ~/Library/Preferences/WebIde?0 | |
rm -rfv ~/Library/Caches/WebIde?0 |
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
import json | |
def readHarFile(): | |
hostList = [] | |
outputPath = '' | |
filePath = raw_input('输入文件路径+名字:') |
npm set registry https://registry.npm.taobao.org # 注册模块镜像 | |
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像 | |
## 以下选择添加 | |
npm set chromedriver_cdnurl http://cdn.npm.taobao.org/dist/chromedriver # chromedriver 二进制包镜像 | |
npm set operadriver_cdnurl http://cdn.npm.taobao.org/dist/operadriver # operadriver 二进制包镜像 | |
npm set phantomjs_cdnurl http://cdn.npm.taobao.org/dist/phantomjs # phantomjs 二进制包镜像 | |
npm set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass # node-sass 二进制包镜像 | |
npm set electron_mirror http://cdn.npm.taobao.org/dist/electron/ # electron 二进制包镜像 | |
npm set selenium_cdnurl=http://npm.taobao.org/mirrors/selenium |
import { urlQuery } from './url'; | |
(function(){ | |
const entryList = performance && performance.getEntries && performance.getEntries(); | |
const country = urlQuery.location_country; | |
const cityid = urlQuery.location_cityid; | |
let linkPerformance = null; |