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 / 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
{
"scripts": [],
"styles": []
}
@xiongchengqing
xiongchengqing / index.html
Last active April 30, 2020 04:43
multiline-ellipsis
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Multiline Ellipsis</title>
</head>
<body>
<div class="multiline-ellipsis-wrapper">
<span class="multiline-ellipsis-content">
@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