Skip to content

Instantly share code, notes, and snippets.

Avatar
👿
work work!

OnO flxxyz

👿
work work!
View GitHub Profile
@flxxyz
flxxyz / CheckIPvNSupport.go
Last active Jan 4, 2021
golang检查ipv4,ipv6的网络支持
View CheckIPvNSupport.go
package main
import (
"os/exec"
"runtime"
"time"
"log"
)
const (
@flxxyz
flxxyz / get_system_version_number.go
Last active Jan 4, 2021
golang get system version number(windows, linux)
View get_system_version_number.go
package main
import (
"bytes"
"io/ioutil"
"log"
"os"
"os/exec"
"strconv"
"regexp"
@flxxyz
flxxyz / convert_path.rs
Created Aug 21, 2020
rust 不同系统转换目录路径
View convert_path.rs
pub fn convert_path(path_str: &str) -> String {
if cfg!(target_os = "windows") {
String::from(path_str.replace("\\", "/"))
} else {
String::from(path_str)
}
}
fn main() {
println!("hello world!");
@flxxyz
flxxyz / main.go
Last active Jun 8, 2020
我的世界(Minecraft)水桶服编译工具
View main.go
package main
import (
"bufio"
"bytes"
"flag"
"github.com/gogs/chardet"
"golang.org/x/text/encoding/japanese"
"golang.org/x/text/encoding/korean"
"golang.org/x/text/encoding/simplifiedchinese"
@flxxyz
flxxyz / ffmpeg.md
Last active Jun 7, 2020
一些ffmpeg命令
View ffmpeg.md
@flxxyz
flxxyz / main.js
Created May 26, 2020
顺序执行promise
View main.js
const arr = []
Array(5).fill(0).forEach((value, index) => {
arr.push(promiseFunc(index))
})
// queue(arr)
//船新解法
arr.reduce((pro,next)=> pro.then(next), Promise.resolve())
@flxxyz
flxxyz / enum.ts
Created May 10, 2020
一些ts的奇怪用法
View enum.ts
//枚举的使用
enum OSName {
windows,
darwin,
linux,
centos,
fedora,
debian,
ubuntu,
suse,
@flxxyz
flxxyz / config_hot_reload.go
Last active May 10, 2020
golang config hot reload
View config_hot_reload.go
package main
import (
"encoding/json"
"io/ioutil"
"log"
"os"
"sync"
"time"
)
@flxxyz
flxxyz / base.js
Last active Apr 22, 2020
常见js排序算法,内置函数sort()除外
View base.js
// 交换函数
Array.prototype.swap = function (i, j) {
[this[j], this[i]] = [this[i], this[j]]
}
@flxxyz
flxxyz / request.js
Created Apr 22, 2020
开箱即用的ajax
View request.js
! function (e) {
var r,
u,
t = [
'Object',
'Array',
'String',
'Number',
'Boolean',
'Function',
You can’t perform that action at this time.