是不是很干净呢?
1 | $ git checkout --orphan empty-branch |
以上内容来自 history,那么多行进行多行编辑呢?Ctrl + Shift + Up
。当然相同内容可以使用 Command + D
更多内容可以点击列选择 - Sublime Text 3 文档
option + 鼠标点选
option + shift + 鼠标拖动
同时也可以设置快捷键同 Sublime
更多内容可以点击怎样在 VSCode 中进行列选择? - 知乎
]]>curl –silent –location https://rpm.nodesource.com/setup_8.x | sudo bash -
yum -y install nodejs
记得删除老版本的npm node
rm /usr/local/bin/npm
yum remove nodesource-release nodejs
yum clean all
rm -rf /var/cache/yum/
rm /etc/yum.repos.d/nodesource-el.repo
yum -y remove nodejs
$env:DEBUG = "*,-not_this"
执行相应的环境。echo $DEBUG
输出相应的环境配置。Mac下是可以使用DEBUG="*" node bin/before-parse.js
。
https://github.com/visionmedia/debug/blob/master/src/node.js
“dev-mac”: “ export NODE_ENV=development&& nodemon –harmony –use_strict index.js -w “,
“dev-win”: “ set NODE_ENV=development&& nodemon –harmony –use_strict index.js -w “,
windows 不太清楚,*NIX 系统下规则如下:
export NODE_ENV=production && node xxx.js 这样在当前命令行下后续的命令中读取 NODE_ENV,都会得到 production 值;
如果直接使用 NODE_ENV=production node xxx.js,则 NODE_ENV 的有效性仅限当前命令,不会对后续命令有影响。
可以使用cross-env
docker machine 静态ip
docke固定ip https://github.com/johnnian/Blog/issues/16
docker run -itd –network bridge –ip 192.168.3.88 springjk/webdev /bin/bash
docker run -itd –network host –ip 192.168.3.88 springjk/webdev /bin/bash
docker: Error response from daemon: user specified IP address is supported on user defined networks only.
larvel 环境
ssh登录 docker exec -it de1aeb89e0f5 /bin/bash
https://blog.csdn.net/qq_34021712/article/details/73379851
docker镜像位置:
For someone who is using Docker toolbox (that uses docker-machine), the answers concerning boot2docker on Mac OS X is not valid. The docker-machine VM is called “default” and it exists in the /Users/
docker image是什么,存储在什么位置
ps -u $USER | grep Docker
docker镜像地址 /Users/{YourUserName}/Library/Containers/com.docker.docker/Data
下载地址: https://www.docker.com/community-edition#/download
https://github.com/docker/kitematic/releases
rsync
ShadowsocksX-NG
配置全局代理就可以,然后并无软用。首先你得有相关的ss账号,可以自己部署,也可以购买相关的服务。
1 | sublime ~/.zshrc |
相关的配置信息可以从这里获取
方法1:
1 | export http_proxy=http://127.0.0.1:1087 |
方法2:
1 | export ALL_PROXY=socks5://127.0.0.1:1086 |
1 | source ~/.zshrc |
另外推荐httpie
。在终端使用http命令,调试api接口
HTTPie—aitch-tee-tee-pie—is a command line HTTP client with an intuitive UI, JSON support, syntax highlighting, wget-like downloads, plugins, and more.
1 | $ brew install httpie |
以下并未实践过,看到关键词做个简单的记录
WePY 是一款让小程序支持组件化开发的框架,通过预编译的手段让开发者可以选择自己喜欢的开发风格去开发小程序。框架的细节优化,Promise,Async Functions的引入都是为了能让开发小程序项目变得更加简单,高效。
1 | $ npm install wepy-cli -g |
使用微信开发者工具导入项目,关闭ES6 转 ES5
微信小程序 button 去除 border
wepy-plugin-image
无法转换
// function createDemoComponents(prefix, component, lenght) {
// const components = {}
// for (let i = 0; i < lenght; i++) {
// const key = prefix + i
// components[key] = component
// }
// return components
// }
// const demoComponents = createDemoComponents(‘btn’, DoButton, 10)
// console.log(demoComponents)
// 组件无效
1:1 error Resolve error: plugins.forEach is not a function import/no-unresolved
1:1 error Resolve error: plugins.forEach is not a function import/no-extraneous-dependencies
1:1 error Resolve error: plugins.forEach is not a function import/no-duplicates
1:1 error Resolve error: plugins.forEach is not a function import/extensions
1:1 error Resolve error: plugins.forEach is not a function import/no-named-as-default
1:1 error Resolve error: plugins.forEach is not a function import/no-named-as-default-member
1:19 error Unable to resolve path to module ‘utils/service’ import/no-unresolved
repeat
不支持添加 @tap
wepy input 数据绑定
less import 路径 alias
https://www.google.com/search?q=wepy+less+import&oq=wepy+less+import&aqs=chrome..69i57.628j0j4&sourceid=chrome&ie=UTF-8
小程序 canvas如何隐藏 display: none; 可行
hexo d -g
,真心觉得麻烦,作为程序猿,就应该学会偷懒,可以少输几次相同的命令,心情甚是愉悦。当然之前也有接触过travis,比如x-citravis的简单使用,团队博客的部署。
使用github账号登录travis 并添加相关的项目
settings->Developer settings->Personal access tokens->点击Generate new token
生成完后拷贝记录下来,后面travis
登录需要用到。刷新页面后台token
将不可见,只能重新生成。
1 | ➜ gem install travis --no-rdoc --no-ri |
如果安装travis无反应,可以更新
gem sources --add https://gems.ruby-china.org/
国内镜像源
然后看下.travis.yml
是不是增加了:
1 | - openssl aes-256-cbc -K $encrypted_11753ec45e06_key -iv $encrypted_11753ec45e06_iv |
travis No such file or directory:bss_file.c:398:fopen(‘~/.ssh/id_rsa’,’w’)1
2
3
`-out ~\/.ssh/id_rsa -d` -> `-out ~/.ssh/id_rsa -d`
- https://github.com/travis-ci/travis.rb/issues/555
remote: Invalid username or password.
fatal: Authentication failed for ‘https://github.com/huixisheng/huixisheng.github.com.git/'
FATAL Something’s wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: remote: Invalid username or password.1
2
在`.travis.yml`添加`ssh -T git@github.com`测试,发现ssh的配置是没问题的。
0.59s$ ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address ‘192.30.253.112’ to the list of known hosts.
Hi cosmeapp/cosmeapp.github.com! You’ve successfully authenticated, but GitHub does not provide shell access.
The command “ssh -T git@github.com“ failed and exited with 1 during .`
再次添加travis-ci
居然成功了。
对于ios,首先想到的是根据页面的js找到对应的universal link。ios9以下和安卓就用schema跳转。
对于京东的链接 https://pro.m.jd.com/mall/active/3pR34myNmV7cXiR4DjzUSRuu5hqA/index.html?ad_od=1&utm_source=kong&utm_medium=zssc&utm_campaign=t_1000210271_100854&utm_term=ea62df13-dc13-44c8-ae00-59b5683ec8f2-p_1999-pr_1076-at_100854&jd_pop=ea62df13-dc13-44c8-ae00-59b5683ec8f2&abt=0 分析源码https://st.360buyimg.com/common/commonH_B/js/m_common_merge2.1.js 网上还找到这个版本的js
1 | aE(e.openAppBtnId, "click", function() { |
1 | function az(aS) { |
测试发现根据代码获得universal link只能打开京东的首页https://linkst.m.jd.com/ul/ul.action?openApp.jdMobile://virtual?params={"category":"jump","des":"m","sourceValue":"babel-act","sourceType":"babel","url":"https%3A%2F%2Fpro.m.jd.com%2Fmall%2Factive%2F3pR34myNmV7cXiR4DjzUSRuu5hqA%2Findex.html%3Fad_od%3D1%26utm_source%3Dkong%26utm_medium%3Dzssc%26utm_campaign%3Dt_1000210271_100854%26utm_term%3Dea62df13-dc13-44c8-ae00-59b5683ec8f2-p_1999-pr_1076-at_100854%26jd_pop%3Dea62df13-dc13-44c8-ae00-59b5683ec8f2%26abt%3D0","M_sourceFrom":"H5_UL","msf_type":"click","NoJumpDownLoadPage":false,"downAppIos":"https%3A%2F%2Fst.360buyimg.com%2Fcommon%2FdownLoadCommon%2FdownLoadAppIOSMPage.html","locationHref":"https%3A%2F%2Fpro.m.jd.com%2Fmall%2Factive%2F3pR34myNmV7cXiR4DjzUSRuu5hqA%2Findex.html%3Fad_od%3D1%26utm_source%3Dkong%26utm_medium%3Dzssc%26utm_campaign%3Dt_1000210271_100854%26utm_term%3Dea62df13-dc13-44c8-ae00-59b5683ec8f2-p_1999-pr_1076-at_100854%26jd_pop%3Dea62df13-dc13-44c8-ae00-59b5683ec8f2%26abt%3D0","m_param":{"m_source":"0","event_series":{},"jda":"122270672.2074471510.1521534916.1522766295.1522991099.5","usc":"kong","ucp":"t_1000210271_100854","umd":"zssc","utr":"ea62df13-dc13-44c8-ae00-59b5683ec8f2-p_1999-pr_1076-at_100854","jdv":"122270672%7Ckong%7Ct_1000210271_100854%7Czssc%7Cea62df13-dc13-44c8-ae00-59b5683ec8f2-p_1999-pr_1076-at_100854%7C1522991529755","ref":"https%3A%2F%2Fpro.m.jd.com%2Fmall%2Factive%2F3pR34myNmV7cXiR4DjzUSRuu5hqA%2Findex.html%3Fad_od%3D1%26utm_source%3Dkong%26utm_medium%3Dzssc%26utm_campaign%3Dt_1000210271_100854%26utm_term%3Dea62df13-dc13-44c8-ae00-59b5683ec8f2-p_1999-pr_1076-at_100854%26jd_pop%3Dea62df13-dc13-44c8-ae00-59b5683ec8f2%26abt%3D0","psn":"2074471510|5","psq":14,"unpl":"V2_ZzNsbRBVFkAiXE9dZx5dVTUfFwlEUV9FdwFHSClNDgFkURpaF1MXQWlJKFRzEVQZJkB8XUNRRAklTShUehhVAWIzEVxCXl8UdxREVWoaXw5mBRldRGdDJXUJR1V4GV0GYQMibXJXQSV0OEVVfRxZA2cHElxyURNHdV1PBC8FCVJvAw5YRABBCSYIE1JnGQhWbwQRW0FQQ0ImOEBS","pc_source":"","mba_muid":"2074471510","mba_sid":"15229910996761532999810513868","mt_xid":"","mt_subsite":""},"SE":{"mt_subsite":"","__jdv":"122270672%7Ckong%7Ct_1000210271_100854%7Czssc%7Cea62df13-dc13-44c8-ae00-59b5683ec8f2-p_1999-pr_1076-at_100854%7C1522991529755","unpl":"V2_ZzNsbRBVFkAiXE9dZx5dVTUfFwlEUV9FdwFHSClNDgFkURpaF1MXQWlJKFRzEVQZJkB8XUNRRAklTShUehhVAWIzEVxCXl8UdxREVWoaXw5mBRldRGdDJXUJR1V4GV0GYQMibXJXQSV0OEVVfRxZA2cHElxyURNHdV1PBC8FCVJvAw5YRABBCSYIE1JnGQhWbwQRW0FQQ0ImOEBS","__jda":"122270672.2074471510.1521534916.1522766295.1522991099.5"}}
初步怀疑:
猜测的结论
通过测试其他的app打开京东的页面,首次有弹框是否打开京东的提示,确认后下次就没有,然而美妆心得的App就是无反应。
近期苹果公司iOS 9系统策略更新,限制了http协议的访问,此外应用需要在“Info.plist”中将要使用的URL Schemes列为白名单,才可正常检查其他应用是否安装。 来自 https://www.jianshu.com/p/a8cce94d508e
定位代码1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27e.exports = function(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
if ("TB" != n.aliapp.appname && "TB-PD" != n.aliapp.appname) {
t.point = t.point || {},
t.point.callType = t.callType;
var a = (0,
r.default)(e, t)
, s = {
package: "com.taobao.taobao"
};
switch (t.callType) {
case "universalLink":
if (n.os.isIPhone && n.os.version.gte("9.0")) {
var l = (0,
o.appendParams)(t.universalLink || "//b.mashort.cn/ulk/taobao", {
smburl: encodeURIComponent(a)
});
t.redirectUrl && (l = (0,
o.appendParams)(l, {
redirectUrl: encodeURIComponent(t.redirectUrl)
})),
(0,
i.default)(l, "universalLink")
} else
(0,
i.default)(a, "scheme", s);
break;
获得的universal link。测试发现其实分享的淘宝口令http://m.tb.cn/h.WE82pie本身就是universal link
项目中碰到了问题,该去哪,谷歌、度娘不行的话,不妨试试以下网址,或许你就可以找到解决问题的办法。
2018-04-01
2016-10-22
1 | Uncaught TypeError: Object function Object() { [native code] } has no method 'assign' |
解决版本1
import 'core-js/fn/object/assign';
ant-design 直接使用Object.assign 有兼容性问题(Android5,iOS8.4) #87
统一使用 object-assign
How do I get Object.assign to work with 6to5 polyfill?
1 | $ pod update --verbose --no-repo-update |
1 | // TDD |
-- recursive执行子目录
Mocha默认运行test子目录里面的测试脚本。所以,一般都会把测试脚本放在test目录里面,然后执行mocha就不需要参数了。
mocha.opts
出现如下报错1
2
3
4SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:607:28)
1 | $ ./node_modules/mocha/bin/mocha --require babel-register --require babel-polyfill |
mocha --compilers js:babel-register
已经废弃。具体见compilers deprecation
相关issue SyntaxError: Unexpected token import #3228 ES6 import not working when using babel in Mocha. #2655 Babel unexpected token import when running mocha tests
Move the invocation into the parens that contain the function wrap-iife
done()
1 | Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. |
如果确实耗时过长的的设置--timeout
,this.timeout(3000);
相关issue timeout of 2000ms exceeded. Ensure the done() callback is being called in this test. #2025
ReferenceError: window is not defined
get request
(node:13054) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 63): [object Object]
NPM
镜像就是用这个搭建的。npmjs私有包是要收费的,对于公司而言更倾向于自己部署,一是省钱,二是一些含有敏感内容的包放到其他平时总是不放心。
本文将简单记录下实际安装过程中碰到的问题,基本的安装可以移步官方文档。
1 | $ yum install -y nodejs |
以上部分命令来源于网络,时隔太久,找不到相关的出处,😶。
1 | [npminstall:get] retry GET http://xx.xx.xx.xx:7001xx-debug after 100ms, retry left 4, error: SyntaxError: Unexpected token l in JSON at position 0 |
发现原因是npm>=5.6
的时候有这个问题1
2
3
4
5➜ huixisheng.github.com git:(dev) ✗ npm -v
5.4.1
➜ huixisheng.github.com git:(dev) ✗ cnpm -v
cnpm@5.1.1 (/usr/local/lib/node_modules/cnpm/lib/parse_argv.js)
npm@5.6.0 (/usr/local/lib/node_modules/cnpm/node_modules/npm/lib/npm.js)
1 | /** |
默认是在 $HOME/.cnpmjs.org/nfs 下面。具体看config配置
https://github.com/cnpm/cnpmjs.org/issues/635
https://github.com/cnpm/cnpmjs.org/issues/925
1 | # 推送全部tag |
1 | # 修改已有的origin |
Mac下
--exclude
需要写在前面
1 | $ tar -czvf /Users/huixisheng/Desktop/j-excel.tar.gz --exclude j-excel/node_modules j-excel/ |
1 | nohup node index.js > error.log 2>&1 & |
1 | nohup: redirecting stderr to stdout |
直接安装过Node6.x,需要在机器上部署yapi。需要升级Node。
1 | # 这个是否需要不确定 |
ssh
连接都要输入密码,真的很麻烦。[ykq@10-10-215-141 .ssh]$ ll
total 8
-rw-r–r– 1 ykq root 417 Aug 21 21:29 authorized_keys
-rw-r–r– 1 ykq root 1987 Feb 9 11:25 known_hosts
20 vi /etc/ssh/ssh_config
21 vi /etc/ssh/sshd_config
22 sudo chmod 755 ~/webpack-mhome.json
23 sudo chmod 777 ~/webpack-mhome.json
24 vi /etc/ssh/sshd_config
25 sudo vi /etc/ssh/sshd_config
26 sudo service ssh restart
27 which ssh
28 sudo chown ykq ~/webpack-mhome.json
29 sudo chown a+x ~/webpack-mhome.json
30 sudo vi /etc/ssh/sshd_config
PasswordAuthentication yes
➜ ssh-copy-id -i ~/.ssh/motian-server.pub root@xx.xx
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: “/Users/huixisheng/.ssh/motian-server.pub”
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed – if you are prompted now it is to install the new keys
root@xx.xx‘s password:
/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
Number of key(s) added: 1
Now try logging into the machine, with: “ssh 'root@xx.com‘“
and check to make sure that only the key(s) you wanted were added.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
ssh-keygen -t rsa -f ~/.ssh/github -C "emailssh-add ~/.ssh/githubhttp://www.html-js.com/article/2379
sudo vim /etc/ssh/sshd_config
PubkeyAuthentication yes
PasswordAuthentication yes
Redirecting to /bin/systemctl restart ssh.service
Failed to restart ssh.service: Unit not found.
centos7下重启sshd服务的操作方法
在centos7下重启服务不再是 service 服务名称 动作 这样的方式的.而是:
systemctl 动作 服务名.service
systemctl status sshd.service
看到的这样的信息就可以确定是启动了.
systemctl start sshd.service
systemctl restart sshd.service
systemctl enable sshd.service
用mac终端命令登录阿里云服务器,出现错误提示Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
http://blog.csdn.net/gigijingjing/article/details/76726564
vue
,vue-router
实现的页面在该设备下"Mozilla/5.0 (Linux; Android 5.1.1; YQ601 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Mobile Safari/537.36,Cosmeapp/9.1.0"
空白。其他现有设备是正常的。想到可以连接真机设备进行调试,根据报错定位到相关的代码有问题,还是资源加载异常(比如cdn的资源在某些环境下异常)。然而连接usb
无发审查元素。于是跑源码在本地环境下进行局域调试,结果页面也是空白。在页面注入weinre
。有报错,但是不要定位,只是显示了报错。这里不得不吐槽下weinre
确实不怎么好用。有看到过资料安卓的真机调试是需要客户端支持的。Uncaught SyntaxError: Use of const in strict mode.
node_modules/_strip-ansi@4.0.0@strip-ansi/index.js
// ‘use strict’;
// var ansiRegex = require(‘ansi-regex’);
// module.exports = input => typeof input === ‘string’ ? input.replace(ansiRegex(), ‘’) : input;
‘use strict’;
var ansiRegex = require(‘ansi-regex’)();
module.exports = function (str) {
return typeof str === ‘string’ ? str.replace(ansiRegex, ‘’) : str;
};
// node_modules/_ansi-regex@3.0.0@ansi-regex/index.js
‘use strict’;
module.exports = function() {
// const -> var
var pattern = [
‘[\u001B\u009B][\#;?](?:(?:(?:[a-zA-Z\d](?:;[a-zA-Z\d]))?\u0007)’,
‘(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PRZcf-ntqry=><~]))’
].join(‘|’);
return new RegExp(pattern, 'g');
};
Open Source CDN free, fast, and reliable
官方网址: https://www.jsdelivr.com/
GitHub仓库:https://github.com/jsdelivr/jsdelivr
支持npm
仓库资源同步, github
资源同步,还支持WordPress.org plugins
。就目前体验而言,速度还不错。提供相关的CDN分析工具,支持combo合并,自动压缩资源,支持SRI。还有DNS分析工具 功能不要太强大,如果访问速度不会因为xx被阻拦在门口,绝对是最佳选择。五星好评推荐。
稳定、快速、免费的前端开源项目 CDN 加速服务。截止写这个文章共收录了 3245 个前端开源项目
官方网址: http://www.bootcdn.cn/
支持检索,速度还不错,但是就是相比unpkg.com资源欠缺。
官方网址: https://unpkg.com/#/
资源绝对丰富,同步npmjs.com。但是速度不行,可惜。同时不支持检索,当然检索可以用https://www.npmjs.com/ 搜索替代。
常用前端公共库 CDN 服务
常用前端公共库 & 和谐使用 Google 公共库、字体库的方法
官方网址: https://css.net/
官网网址: http://cdnjs.com/
静态资源
CDN
公共库是指一些服务商将我们常用的前端资源JavaScript
,CSS
等前端静态资源存放在网上,方便直接引用,并且提供CDN
加速服务,这样一来可以让用户加速访问这些资源,二来还可节约自己服务器的流量。本文介绍常用的前端静态资源CDN公共库。
CDN的全称是Content Delivery Network
,即内容分发网络。其基本思路是尽可能避开互联网上有可能影响数据传输速度和稳定性的瓶颈和环节,使内容传输的更快、更稳定。通过在网络各处放置节点服务器所构成的在现有的互联网基础之上的一层智能虚拟网络,CDN系统能够实时地根据网络流量和各节点的连接、负载状况以及到用户的距离和响应时间等综合信息将用户的请求重新导向离用户最近的服务节点上。其目的是使用户可就近取得所需内容,解决 Internet网络拥挤的状况,提高用户访问网站的响应速度。
知乎做的https://unpkg.com/#/的镜像 unpkg.zhimg.com。
饿了么做的https://unpkg.com/#/的镜像
npm.elemecdn.com。例 https://npm.elemecdn.com/jquery@3.2.1/dist/jquery.min.js
饿了么做的https://unpkg.com/#/的镜像
例外还有github.elemecdn.com。例如 https://github.elemecdn.com/eleme/ubt-web/1.3.4/ubt.min.js。规则没有琢磨透。
以上并没有开源,没有开发访问。不建议使用。
2016-10-21