Skip to content

Instantly share code, notes, and snippets.

View caoer's full-sized avatar
🎯
Focusing as always

Zitao Xiong caoer

🎯
Focusing as always
View GitHub Profile
@caoer
caoer / autossh-jump-rtunnel.service
Created August 21, 2019 08:02 — forked from ntrepid8/autossh-jump-rtunnel.service
AutoSSH reverse tunnel service config for systemd
[Unit]
Description=AutoSSH reverse tunnel service for jump.you.io 100022 -> 22
After=network.target
[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -M 0 -o "ExitOnForwardFailure=yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -NR 10022:127.0.0.1:22 [email protected] -i /home/root/.ssh/id_rsa
[Install]
WantedBy=multi-user.target
https://miqu.me/blog/2017/06/16/fixing-autocompletion-on-mixed-objective-c-and-swift-projects/
export SOURCEKIT_LOGGING=3 && /Applications/Xcode6-Beta2.app/Contents/MacOS/Xcode
{"sig":"fa5cbae791ae3e237da9b763e11913a3b67600a6cce56b3f188d2a0d2b3fd6e780cfd8de60e5e73cc2bd55c176cc7bcb95523e35d16bef72c9587e91903354690","msghash":"2094ab44298b3ce60f4ded71387a5917b5061f4ef35a6fc722becb3027d9a0a0"}
@caoer
caoer / better-nodejs-require-paths.md
Created November 3, 2017 22:26 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

# Configuration for Alacritty, the GPU enhanced terminal emulator
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty it self.
env:
# TERM env customization.
#
# If this property is not set, alacritty will set it to xterm-256color.
#
var csv = ''
for (var i of document.querySelectorAll('.comment-wrapper ul li')) {
const name = i.childNodes[0].childNodes[1].innerHTML;
const chat = i.childNodes[1].innerText
csv = csv + name + ',';
csv = csv + chat + '\n'
}
console.log(csv)
@caoer
caoer / question.js
Created June 21, 2017 06:22
what is outputs?
const DynamicObject = nativeClassesRegistry.getOrCreateNativeClass('NSObject', null);
const dynamicObject = new DynamicObject();
dynamicObject.sayName = function () {
console.log(`d: ${dynamicObject.prototype}`);
console.log(`1: ${DynamicObject.prototype === Object.getPrototypeOf(dynamicObject)}`);
console.log(`2: ${DynamicObject.prototype === dynamicObject.prototype}`);
console.log(`3: ${Object.getPrototypeOf(dynamicObject) === dynamicObject.prototype}`);
console.log(`4x: ${dynamicObject.prototype}`);
console.log(`5z: ${Object.getPrototypeOf(Object.getPrototypeOf(dynamicObject)).constructor.nativeClassName}`);
console.log(`6y: ${dynamicObject.constructor.prototype.constructor.nativeClassName}`);

Keybase proof

I hereby claim:

  • I am caoer on github.
  • I am zitao (https://keybase.io/zitao) on keybase.
  • I have a public key ASC16xiO3KrCwcl_iuh-maZ0XAZzOZag5zMpFlJCVultjQo

To claim this, I am signing this object:

OpenDNS
208.67.222.222
208.67.220.220
GoogleDNS
8.8.8.8
8.8.4.4
docker run -td --name kcptun \
-p 6000:6000 \
-p 29900:29900/udp \
-e PASSWORD=password \
-e FAST_OPEN=-a \
-e SERVER_PORT=6000 \
-e METHOD=aes-256-cfb \
-e ONE_TIME_AUTH=-a \
-e KCPTUN_FLAG=true \
-e KCPTUN_CONFIG="{\"acknodelay\":false,\"crypt\":\"salsa20\",\"datashard\":35,\"dscp\":46,\"end\":0,\"interval\":20,\"keepalive\":10,\"listen\":\":29900\", \"key\": \"password\",\"mode\":\"fast2\",\"mtu\":1350,\"nc\":0,\"nocomp\":true,\"nodelay\":0,\"parityshard\":6,\"rcvwnd\":256,\"resend\":2,\"sndwnd\":64,\"sockbuf\":4194304,\"target\":\"0.0.0.0:6000\"}" \