Skip to content

Instantly share code, notes, and snippets.

View hemisu's full-sized avatar
😏

Hemisu hemisu

😏
View GitHub Profile
@hemisu
hemisu / uf.js
Last active June 6, 2021 12:00
union find
class UF {
constructor(n) {
this.parent = []
this.size = []
this.count = n
while(n--) {
this.parent[n] = n
this.size[n] = 1
}
}

mac配置v2ray命令行开机自启动

参考文档: CreatingLaunchdJobs

编写plist文件

例子中用户名为name【】需要删除

com.name.v2ray

@hemisu
hemisu / cloudSettings
Last active September 25, 2020 08:11
vscode
{"lastUpload":"2020-09-25T08:10:47.975Z","extensionVersion":"v3.4.3"}
@hemisu
hemisu / Node.js文件拷贝
Created June 25, 2018 10:39
Node.js本地文件拷贝几种不同的方法
var fs = require('fs');
//fs异步拷贝版本
fs.readFile('./img/1.jpg', function(err, data) {
if (err) {
console.log('read fail!');
} else {
console.log('reading data...');
write(data);
}
@hemisu
hemisu / manage-etc-hosts.sh
Created June 25, 2018 09:34 — forked from irazasyed/manage-etc-hosts.sh
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1