Skip to content

Instantly share code, notes, and snippets.

View xiongchengqing's full-sized avatar
🇨🇳
Never stop learning

Xiong,Cheng-Qing xiongchengqing

🇨🇳
Never stop learning
View GitHub Profile
@xiongchengqing
xiongchengqing / LICENSE.md
Created December 30, 2022 01:55 — forked from sj26/LICENSE.md
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

OS=`echo \`uname\` | tr '[:upper:]' '[:lower:]'`
AURL="https://gist.githubusercontent.com/hightemp/5071909/raw/"
ANAME=".bash_aliases"
TMPAPATH="/tmp/$ANAME"
HOMEAPATH="~/$ANAME"
[ "$OS" = "windowsnt" ] && OS_WIN="yes"
[ "$OS" = "darwin" ] && OS_MAC="yes"
[ "$OS" = "linux" ] && OS_LIN="yes"
@xiongchengqing
xiongchengqing / mapValues.ts
Last active September 17, 2021 06:44 — forked from steveruizok/mapValues.ts
Map values.
/**
* 外提
*
* @param obj
* @param fn
* @returns remapped obj
*/
export function remap<P, T>(
obj: { [key: string]: T },
fn: (value: T, index: number) => P
@xiongchengqing
xiongchengqing / m3u8-to-mp4.md
Created April 21, 2019 16:36 — forked from tzmartin/m3u8-to-mp4.md
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@xiongchengqing
xiongchengqing / log-traps.js
Created August 11, 2017 02:51 — forked from LeaVerou/log-traps.js
Log all proxy traps
function createLoggedProxy(obj) {
var traps = {};
for (let trap of Object.getOwnPropertyNames(Reflect)) {
traps[trap] = (...args) => {
console.log(trap, ...args.slice(0, -1)); // Last arg is always the proxy, no need to log it
return Reflect[trap](...args);
}
}
@xiongchengqing
xiongchengqing / README.md
Created July 10, 2017 06:48 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet