Skip to content

Instantly share code, notes, and snippets.

to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
ffmpeg docs:
https://ffmpeg.org/ffmpeg.html
-y : yes to all
-i filename (input)
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@gnipbao
gnipbao / raf.js
Last active September 18, 2019 03:50
Drop in replace functions for setTimeout and setInterval that make use of requestAnimationFrame.
(function(window) {
let lastTime = 0,
vendors = ['webkit', 'moz'],
requestAnimationFrame = window.requestAnimationFrame,
cancelAnimationFrame = window.cancelAnimationFrame,
i = vendors.length;
// try to un-prefix existing raf
while (--i >= 0 && !requestAnimationFrame) {
requestAnimationFrame = window[vendors[i] + 'RequestAnimationFrame'];
@gnipbao
gnipbao / combinators.js
Created September 12, 2019 09:43 — forked from Avaq/combinators.js
Common combinators in JavaScript
const I = x => x;
const K = x => y => x;
const A = f => x => f(x);
const T = x => f => f(x);
const W = f => x => f(x)(x);
const C = f => y => x => f(x)(y);
const B = f => g => x => f(g(x));
const S = f => g => x => f(x)(g(x));
const P = f => g => x => y => f(g(x))(g(y));
const Y = f => (g => g(g))(g => f(x => g(g)(x)));
@gnipbao
gnipbao / webkitmediasource-is-type-supported.html
Created August 28, 2018 03:43 — forked from granoeste/webkitmediasource-is-type-supported.html
[JavaScript][HTML5][MediaSource] MediaSource.isTypeSupported
<!DOCTYPE html>
<html>
<head>
<script>
window.MediaSource = window.MediaSource || window.WebKitMediaSource;
function testTypes(types) {
for (var i = 0; i < types.length; ++i)
console.log("MediaSource.isTypeSupported(" + types[i] + ") : " + MediaSource.isTypeSupported(types[i]));
}
@gnipbao
gnipbao / ffmpeg常用操作.md
Created August 28, 2018 02:37 — forked from hellokaton/ffmpeg常用操作.md
ffmpeg常用操作

提取音频

ffmpeg -i a.mp4 -f mp3 -vn a.mp3

提取视频

ffmpeg -i a.mp4 -vcodec copy -an b.mp4
@gnipbao
gnipbao / ribbon.js
Created May 11, 2017 06:54
ribbon effects
+ function() {
function attr(node, attr, default_value) {
return Number(node.getAttribute(attr)) || default_value;
}
// get user config
var scripts = document.getElementsByTagName('script'),
script = scripts[scripts.length - 1]; // 当前加载的script
config = {
z: attr(script, "zIndex", -1), // z-index
@gnipbao
gnipbao / pyenv.md
Created March 19, 2017 05:58 — forked from miminus/pyenv.md
为Mac 设置Python多版本开发环境

##参考链接

##问题 - 可能会遇到多个版本同时部署的情况

  • 系统自带的Python是2.x,自己需要Python 3.x,测试尝鲜;
  • 系统是2.6.x,开发环境是2.7.x
  • 由于Mac机器系统保护的原因,默认的Python中无法对PIP一些包升级,需要组建新的Python环境
  • 此时需要在系统中安装多个Python,但又不能影响系统自带的Python,即需要实现Python的多版本共存。pyenv就是这样一个Python版本管理器

##解决方法 - pyenv

@gnipbao
gnipbao / spider_pic.js
Created December 26, 2016 10:26
nodejs爬虫抓取图片
//依赖模块
var fs = require('fs');
var request = require("request");
var cheerio = require("cheerio");
var mkdirp = require('mkdirp');
//目标网址
var url = 'http://www.mmjpg.com/';
//本地存储目录