CustomEvent 自定义事件

Constructor

CustomEvent()
Creates a CustomEvent.

the constructor accepts 2 arguments

CustomEvent(typeArg, customEventInit)

typeArg
Is a DOMString representing the name of the event.

customEventInit (Optional)
Is a CustomEventInit dictionary, having the following fields:
“detail”, optional and defaulting to null, of type any, that is an event-dependent value associated with the event.

 

example:

 

reference : https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent

linux 配置免密钥自动登录

reference: http://www.linuxproblem.org/art_9.html

 

Your aim

You want to use Linux and OpenSSH to automate your tasks. Therefore you need an automatic login from host A / user a to Host B / user b. You don’t want to enter any passwords, because you want to call ssh from a within a shell script.

 

How to do it

First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:

 

Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):

 

Finally append a’s new public key to b@B:.ssh/authorized_keys and enter b’s password one last time:

 

From now on you can log into B as b from A as a without password:

 

A note from one of our readers: Depending on your version of SSH you might also have to do the following changes:

  • Put the public key in .ssh/authorized_keys2
  • Change the permissions of .ssh to 700
  • Change the permissions of .ssh/authorized_keys2 to 640

求生之路2 创意工坊VPK批量改名

由于l4d2创意工坊的一个老bug,导致总是重新下载vpk,得取消订阅+移动到addon文件夹下,为方便区分,将vpk批量重命名。

需要安装l4d2 authoring tools,需要vpk.exe进行解包操作,读取addoninfo.txt内的信息命名vpk

将vpk和jpg放在脚本目录下运行即可

ccsu 一键评教

win10下displayport 显示器关闭后图标窗口错位

最近把显示器从AOC D2357ph 换成了Dell P2415Q,显示接口从hdmi换成了displayport

显示器是舒服了,但是一关屏就会发生桌面图标错位,窗口大小缩小到左上角

检测到关屏后分辨率为1024*768

百度了半天表示什么也搜不到

google后发现解决方案

https://www.reddit.com/r/Windows10/comments/36gb6z/windows_is_always_resizing_my_windows/

and

http://rcaloca.blogspot.hk/2014/12/windows-changing-size-position-after.html

修改注册表中模拟显示器的分辨率即可

Untitled

任务栏错位问题是dpi缩放导致的
在关屏下用猎豹wifi遥控,修改simulator显示器的dpi缩放和主显示器一致就好了~

 

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlGraphicsDriversConfiguration

需要修改

PrimSurfSize.cx

PrimSurfSize.cy

Stride

三个值与显示器一致

是在下输了 in Dota2

是在下输了.ahk
是在下输了1080p.ahk
脚本第三行修改快捷键

 

调整比例js脚本