Skip to content

Instantly share code, notes, and snippets.

View wangduanduan's full-sized avatar
🎯
Focusing

wangduanduan wangduanduan

🎯
Focusing
View GitHub Profile
@wangduanduan
wangduanduan / pcap2wav
Created June 22, 2022 23:23 — forked from avimar/pcap2wav
Convert raw PCAP files into a .wav file
#!/bin/bash
#
# pcap2wav
# Original Author: Michael Collins <msc@freeswitch.org>
#Standard disclaimer: batteries not included, your mileage may vary...
# Updated by Avi Marcus <avi@bestfone.com>
#
# Accepts arg of pcap file w/only 2 RTP streams
# Creates a .<codec> file and a .wav file
# For codecs other than PCMA and PCMU the script calls fs_cli and does a little recording to create the wav file(s)
@wangduanduan
wangduanduan / pcap2wav
Created November 26, 2020 08:27 — forked from kamaal44/pcap2wav
Convert raw PCAP files into a .wav file
#!/bin/bash
#
# pcap2wav
# Original Author: Michael Collins <msc@freeswitch.org>
#Standard disclaimer: batteries not included, your mileage may vary...
# Updated by Avi Marcus <avi@bestfone.com>
#
# Accepts arg of pcap file w/only 2 RTP streams
# Creates a .<codec> file and a .wav file
# For codecs other than PCMA and PCMU the script calls fs_cli and does a little recording to create the wav file(s)
@wangduanduan
wangduanduan / formatTimestamp.js
Last active May 19, 2017 07:56
[获取当前时间戳] #tags: timestamp
function formatTimestamp() {
var timestamp = new Date();
var year = timestamp.getFullYear();
var date = timestamp.getDate();
var month = ('0' + (timestamp.getMonth() +1)).slice(-2);
var hrs = ('0' + timestamp.getHours()).slice(-2);
var mins = ('0' + timestamp.getMinutes()).slice(-2);
var secs = ('0' + timestamp.getSeconds()).slice(-2);
var ms = timestamp.getMilliseconds();
@wangduanduan
wangduanduan / text-no-wrap.md
Created May 13, 2017 04:53
[文字强制不换行,超过显示省略号] #tags: nowrap
// 强制不换行
div{
	white-space: nowrap;
}

// 自动换行
div{ 
	word-wrap: break-word; 
	word-break: normal; 
@wangduanduan
wangduanduan / ifram-post-message.md
Last active May 10, 2017 03:42
[父页面如何输出iframe里面的变量,或者调用iframe里面的方法?] #tags: iframe, postMessage
// 父页面中
// html 
<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
@wangduanduan
wangduanduan / mutil-vue-object-share-one-method.js
Created May 5, 2017 03:53
[多个vue实例共享一个方法] #tags: vue
var v1 = new Vue({
el:'#app',
data:{
num: 0
},
methods:{
addOne: function(){
addOne.call(this);
}
}
@wangduanduan
wangduanduan / thinkpad-f1-f12-swap-ctrl-fn.md
Last active May 2, 2017 09:10
[thinkpad 系列恢复F1-F12原始功能,切换ctrl和fn的位置] #tags: thinkpad,fn

1 实验准备

  • T450笔记本

2 进入BIOS

  1. 重启电脑
  2. 一直不停按enter
  3. 按F1
  4. 选择Keyboard/mouse

3 恢复F1-F2恢复原始功能:

@wangduanduan
wangduanduan / function-coding.md
Created May 1, 2017 08:29
[我的函数式编程规范] #tags: coding, function
  • 一行代码如果可能会出现在两个地方,那么请把它写成一个函数
@wangduanduan
wangduanduan / wellClient-add-some-event-field.md
Last active April 29, 2017 10:25
[软电话 事件建议增加的参数] #tags:wellClient

挂断事件建议增加字段

  • callId产生的时间
  • 通话是否接听
  • 挂断方的号码
  • 呼叫类型

最好提供一个接口,可以根据callId去查询这个call的详细信息

@wangduanduan
wangduanduan / ie11-devtool-bugs.md
Created April 27, 2017 09:05
[win7 ie11 开发者工具打开后一片空白] #tags: ie11,win7