Skip to content

Instantly share code, notes, and snippets.

View SherryQueen's full-sized avatar
😶
Learning.

MySherry SherryQueen

😶
Learning.
  • china
  • shanghai
View GitHub Profile
ps aux|grep java|awk '{print $2}'|xargs kill -9 批量杀死进程
tail -f filename 监听文件变化 及显示内容 -f 循环读取
sudo netstat -tunlp|grep {number} 查看端口使用情况
meteor-simple-schema autoValue自动生成值 在 schema.clean的过程中
pdf 盖章
magick convert -density 300 origin.pdf from.png # pdf转换城png
magick convert from-1.png -compose over sign.png -geometry 403x403+1680+1600 -composite new.png # 在目标png上进行图片盖章 即将章图片覆盖到底图上
magick convert -density 300 from-0.png new.png to.pdf # 将盖完章的图重新合成pdf
magick convert from.png -resize '3507x4960>' -background white -gravity center -extent '3507x4960>' to.png # 图片居中补白
magick convert .\1.png -crop 170x170+332+0 20.png # 图片裁剪
@SherryQueen
SherryQueen / nginx.conf
Created August 25, 2017 06:18
nginx 配置
user www-data; # 用户组
worker_processes 2; # 工作核心
# 进程id位置
pid /run/nginx.pid;
events {
use epoll; # 设置工作模式
worker_connections 768; # 单进程最大连接数
}
@SherryQueen
SherryQueen / npm
Last active January 27, 2018 15:43
npm i --registry https://registry.npm.taobao.org
npm i -g npm-check-updates vue-cli webpack express-generator mocha --registry https://registry.npm.taobao.org # node 版本更新后需要安装的
npm config set cache 'D:\Path\npm\npm-cache'
npm config set prefix 'D:\Path\npm\npm-global'
// 将键绑定放入此文件中以覆盖默认值
[
{
"key": "ctrl+shift+u",
"command": "editor.action.transformToUppercase"
},
{
"key": "ctrl+u",
"command": "editor.action.transformToLowercase"
}
@SherryQueen
SherryQueen / nginx.conf
Created November 1, 2017 06:55
nginx location 学习
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@SherryQueen
SherryQueen / js
Last active February 27, 2018 09:02
前端
浏览器: setTimeout 与 setInterval 将队列加入任务队列中(只有当队列中任务执行完才会加入到执行栈中 在下一tick中检查计时——误差(若一tick执行过长
node: setImmediate 当前任务队列最后插入对应的事件 即总在下一个事件循环中开始执行对应的回调(在执行栈的栈顶
export default 时候 导出对象会 绑定到 default 对象
需要通过 import ans from '' 来引用 而不能使用解构语法
@SherryQueen
SherryQueen / node
Last active September 13, 2018 13:23
编码相关
require/exports 社区规范 可动态加载模块 地址可寻找 传递值或引用
import/export es6规范 静态编译 地址不可寻 强制 值绑定 即 将所有模块加载到一个js里面
隐藏类
v8 会将拥有相同属性的(按相同顺序声明的同类型的对象 在vm中构建一个隐藏类 从而加快读取优化) 采用地址偏移从而避免高消耗的寻址
内联缓存
基于隐藏类, 在两次查找隐藏类后直接将偏移地址添加到对象上从而直接使用
事件队列
每个tick检查事件是否需要处理(检查已加入队列中的回调(完成的回调事件
@SherryQueen
SherryQueen / package.json
Created November 16, 2017 08:34
webpack 配置
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-es2015": "^6.24.1",
"css-loader": "^0.28.7",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^1.1.5",
"html-webpack-plugin": "^2.30.1",
"node-sass": "^4.5.3",
"optimize-css-assets-webpack-plugin": "^3.2.0",