Skip to content

Instantly share code, notes, and snippets.

Avatar
👻
stayhome

flxxyz flxxyz

👻
stayhome
View GitHub Profile
@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 / get_system_version_number.go
Last active May 10, 2020
golang get system version number(windows, linux)
View get_system_version_number.go
package main
import (
"bytes"
"io/ioutil"
"log"
"os/exec"
"regexp"
"runtime"
)
@flxxyz
flxxyz / request.js
Created Apr 22, 2020
开箱即用的ajax
View request.js
! function (e) {
var r,
u,
t = [
'Object',
'Array',
'String',
'Number',
'Boolean',
'Function',
@flxxyz
flxxyz / Tween.js
Created Sep 17, 2019
常用的运动算法
View Tween.js
/*
* Tween.js
* t: current time(当前时间)
* b: beginning value(初始值)
* c: change in value(变化量)
* d: duration(持续时间)
*/
var Tween = {
Linear: function(t, b, c, d) { return c*t/d + b; },
Quad: {
@flxxyz
flxxyz / App.vue
Last active Aug 26, 2019
Vue注册全局指令,实现在标签上编码markdown
View App.vue
<template>
<div id="app">
<Test/>
</div>
</template>
<script>
import Test from './Test'
export default {
You can’t perform that action at this time.