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 / README.md
Created July 10, 2017 06:48 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@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 / 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 / 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">
{
"scripts": [],
"styles": []
}
@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 / macOS tips and tricks.md
Last active October 14, 2021 06:14
macOS tips and tricks

Q:如何在 spotlight 中快速打开文件所在位置?

按住 cmd 双击列表中的文件即可,也可以先选中列表中的文件再按组合键 cmd + R。选中某个文件按住 cmd 键,在预览侧底部会显示文件所在的路径。

screen_cast_reveal_file_with_shortcuts

import mergeWith from 'lodash/mergeWith'
const m1 = { a: 1, b: 2 }
const m2 = { a: 9, c: 3 }
const m3 = { a: 4, b: 5, d: 7 }
// Lodash version
// merge objects with customizer
mergeWith(m1, m2, m3, (objValue, srcValue, key, object) => {
if (Object.prototype.hasOwnProperty.call(object, key)) {
{
"scripts": [],
"styles": []
}