This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function.prototype.call = function (context, ...args) { | |
context = context === undefine || context === null ? window : Object(context) | |
const fn = Symbol('fn') | |
context[fn] = this | |
const result = context[fun](...args) | |
delect context[fn] | |
return result | |
} | |
Function.prototype.apply = function (context, args = []) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filebeat.prospectors: | |
- input_type: log | |
paths: | |
- /var/log/project/*.log | |
json.keys_under_root: true | |
json.add_error_key: true | |
json.overwrite_keys: true | |
output.kafka: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios') | |
const dayjs = require('dayjs') | |
const cheerio = require('cheerio') | |
const gainStarsSum = async user => { | |
const res = await axios.get(`https://api.github.com/users/${user}/repos`) | |
const repos = res.data | |
const starsSum = repos.map(repo => repo.stargazers_count).reduce((a, b) => a +b) | |
console.log(`User ${user} gain ${starsSum} stars.`) | |
return starsSum |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const os = require('os'); | |
const path = require('path'); | |
const exec = require('child_process').exec; | |
const axios = require('axios') | |
const dayjs = require('dayjs') | |
const getJobInfo = async job => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<style> | |
#root, | |
body, | |
html { | |
width: 100%; | |
height: 100%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport | |
airport -I | awk -F': ' '/ SSID/ {print $2}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub 插入打断符() | |
' | |
' 插入打断符 宏 | |
' 每间隔 ds 个字符插入一个打断符,用于打断查重系统读取句子或词语的重复率判断 | |
' 需要导入一个叫 “打断符” 的样式 | |
' 字体样式继承 正文 | |
' 字体后续样式 正文 | |
' 字体大小 1px | |
' 字体颜色 白色 | |
' 字体宽度 0% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install | |
# curl -sL https://gist.github.com/zthxxx/df7e121048b12c80f260285d88e1091f/raw/.screenrc -o ~/.screenrc | |
# curl -s https://gist.githubusercontent.com/zthxxx/df7e121048b12c80f260285d88e1091f/raw/.screenrc -o ~/.screenrc | |
# Shortcut Key binding | |
# https://www.gnu.org/software/screen/manual/screen.html#Bindkey | |
# remap prefix key `Ctrl-A` to `Ctrl-S` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
brew install lrzsz | |
recv='/usr/local/bin/iterm2-recv-zmodem.sh' | |
send='/usr/local/bin/iterm2-send-zmodem.sh' | |
curl -sSL https://github.com/RobberPhex/iTerm2-zmodem/raw/master/iterm2-recv-zmodem.sh -o "$recv" | |
curl -sSL https://github.com/RobberPhex/iTerm2-zmodem/raw/master/iterm2-send-zmodem.sh -o "$send" | |
chmod +x "$recv" "$send" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04 | |
fallocate -l ${SWAP_SIZE:-8G} /swapfile | |
chmod 600 /swapfile | |
swapon /swapfile | |
echo '/swapfile none swap sw 0 0' >> /etc/fstab |