Skip to content

Instantly share code, notes, and snippets.

View Jiang-Xuan's full-sized avatar
😀
Hi~ o(* ̄▽ ̄*)ブ

蒋璇 Jiang-Xuan

😀
Hi~ o(* ̄▽ ̄*)ブ
  • Hangzhou Zhejiang
View GitHub Profile
@Jiang-Xuan
Jiang-Xuan / countdown.js
Created March 1, 2018 02:56
Using Promise get a countdown utility function.
let remain = 60;
const ct = Promise.resolve();
const countdown = (ct) => (Promise.all([new Promise(resolve => {
setTimeout(() => {
remain--;
this.setState({
getCapchacodeRemainTime: remain
});
resolve(remain);
@Jiang-Xuan
Jiang-Xuan / block-and-non-blocking-socket.md
Created February 24, 2018 09:29
blocking and non-blocking socket
@Jiang-Xuan
Jiang-Xuan / shell-calc-login-fingerprint.md
Last active November 15, 2022 07:14
shell 登录指纹验证

在 ssh 登录远程主机的时候, 如果是第一次登录, 一般都会出现如下提示:

The authenticity of host '*.*.*.* (*.*.*.*)' can't be established.
ECDSA key fingerprint is MD5:28:00:72:3d:37:74:6c:84:6d:87:28:d4:3b:0d:ef:28.
Are you sure you want to continue connecting (yes/no)? 

该提示说明远程主机从来没有被登陆过, 无法校验远程主机的真实性, 计算出远程主机给出的 公钥 的摘要.

yum list | grep initscripts

output:

[root@8f3bb0c6a893 ~]# yum list | grep initscripts
initscripts.x86_64                      9.03.58-1.el6.centos.2      updates     
/* Simplified implementation of DOM2 EventTarget.
* http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget
*/
function EventTarget() {
this._listeners = {};
}
EventTarget.prototype.addEventListener = function(eventType, listener) {
if (!(eventType in this._listeners)) {

比如:

enter image description here

用这么一段代码嵌入 DEMO {{EmbedLiveSample("高级一点的例子", "500", "200")}}

要注意这里的 高级一点的例子, 取自<h3 id="高级一点的例子">高级一点的例子</h3>, 在英文原文版本中这里为 <h3 id="Advanced_Example">Advanced Example</h3>.

当在翻译 Advanced Example 的时候翻译为 高级一点的例子, 这时候的 h3id 会跟着变化, 即便是你编辑的时候编辑源码, 把 id 改成英文也是会在编译的生成中文的 id, 修改失效.

@Jiang-Xuan
Jiang-Xuan / flatArray.js
Last active January 11, 2018 07:00
flatArray
const foo = [{
key: 'first'
}, {
key: 'second'
}, {
key: 'third'
}, {
key: 'more',
children: [{
key: 'fourth'

couldn't be more thrilled 万分激动 seamlessly 无缝地 embrace 拥抱 philosophy 哲学 enthusiasm time and time encapsulates incorporate boilerplate caching

@Jiang-Xuan
Jiang-Xuan / controlplane.md
Created November 27, 2017 11:13
mac 上面的controlpanel software

由 mac 唤醒事件 引出来的软件

mac 上面的定时事件由 launchd 负责执行和守护, 不过悲哀的是 launchd 不提供 mac 唤醒事件, 我这么不爱关机的人就比较麻烦, 因为在我唤醒 mac 的时候我想执行脚本来处理一系列事情. 所以我百般搜索发现了这个牛掰的软件 ControlPlane.

软件官网 https://www.controlplaneapp.com

Excited !!! Awesome !!!

It is free.