ffmpeg -re -rtsp_transport tcp -i "rtsp://[username]:[password]@[host]:[port]" -c:v libx264 -vprofile baseline -s 712x400 -c:a aac -ar 44100 -strict -2 -ac 1 -f flv "rtmp://example.local"
This file contains 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
// golang 热加载配置文件 | |
// golang config hot reload | |
package main | |
import ( | |
"encoding/json" | |
"io/ioutil" | |
"log" | |
"os" |
This file contains 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
{ | |
"type": "module", | |
"dependencies": { | |
"@alicloud/openapi-client": "^0.3.3", | |
"@alicloud/tea-typescript": "^1.7.1", | |
"@alicloud/vod20170321": "^2.0.1", | |
"ali-oss": "^6.15.0" | |
} | |
} |
This file contains 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
Promise.resolve() | |
.then(() => { | |
return new Promise((resolve) => { | |
setTimeout(() => { | |
resolve(1); | |
}, 3000); | |
}); | |
}) | |
.then((res) => { | |
console.log(res); // 这里就是 1 |
This file contains 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
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" |
This file contains 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
/** | |
* - | |
* @param {string} fmt - | |
* @returns {string} - | |
*/ | |
Date.prototype.format = function (fmt) { | |
const dateObject = { | |
"y+": this.getFullYear(), | |
"M+": this.getMonth() + 1, // 月份 | |
"d+": this.getDate(), // 日 |
This file contains 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
<?php | |
/** | |
* 自定义多进制 | |
* @param $str 自定义的多进制字符串 | |
* @param $num 十进制数字 | |
* @return string | |
* @author alexander_phper | |
* @link https://blog.csdn.net/alexander_phper/article/details/51363491 | |
*/ | |
function xbin($str, $num){ |
This file contains 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
#!/bin/sh | |
#+ip 指定监听的IP | |
#-port 指定端口,个性建服 | |
#-condebug 记录熊孩子的破坏经过 | |
MAP="+map 指定地图名" | |
CONF="$HOME/server.cfg" | |
L4D2_DIR="$HOME/.steam/steamapps/common/Left 4 Dead 2 Dedicated Server" | |
START_PARAMS="-console -game left4dead2 -secure +ip 0.0.0.0 -port 27017 -nomaster -condebug" |
This file contains 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
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!"); |
This file contains 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
//枚举的使用 | |
enum OSName { | |
windows, | |
darwin, | |
linux, | |
centos, | |
fedora, | |
debian, | |
ubuntu, | |
suse, |