Skip to content

Instantly share code, notes, and snippets.

View catalsdevelop's full-sized avatar
🏠
Working from home

Z.Liu catalsdevelop

🏠
Working from home
View GitHub Profile
@catalsdevelop
catalsdevelop / designer.html
Last active August 29, 2015 14:12
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../paper-radio-group/paper-radio-group.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
<link rel="import" href="../topeka-elements/avatars.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
@catalsdevelop
catalsdevelop / easing.js
Created September 14, 2016 05:56 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@catalsdevelop
catalsdevelop / file0.txt
Created September 23, 2016 03:26 — forked from giwa/file0.txt
Install g++/gcc 4.8.2 in CentOS 6.6 ref: http://qiita.com/giwa/items/28c754d8fc2936c0f6d2
$ wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
$ yum install devtoolset-2-gcc devtoolset-2-binutils
$ yum install devtoolset-2-gcc-c++ devtoolset-2-gcc-gfortran
@catalsdevelop
catalsdevelop / cloudSettings
Last active October 13, 2019 21:10
Visual Studio Code Sync Settings GIST
{"lastUpload":"2019-10-13T21:10:44.630Z","extensionVersion":"v3.4.3"}
@catalsdevelop
catalsdevelop / host-network-setup.sh
Created December 8, 2016 14:22 — forked from yousong/qemustart.sh
Run OpenWrt on QEMU virtual machines with LAN and WAN network.
#
# The following script will
# - Create Linux bridge $BR_WAN, $BR_LAN
# - Install IP addresses and basic routes
# - Enable proxy_arp on $BR_WAN
# - Enable ip_forward
# - Enable MASQUERADE on $IF_INET
# - $BR_LAN, $BR_WAN has to be allowed in ~/.usr/etc/qemu/bridge.conf
#
@catalsdevelop
catalsdevelop / custom-nav-walker-usage.php
Created April 26, 2017 02:34 — forked from kosinix/custom-nav-walker-usage.php
WordPress: Using a custom nav walker to create navigation menus in plain <a> tags. That is the <ul> and <li> tags are not present. Very useful if you want to create simple links that can be centered with a simple text-align:center on the containing element.
<?php
// In your template files like footer.php
// The items_wrap value ('%3$s') removes the wrapping <ul>, while the custom walker (Nav_Footer_Walker) removes the <li>'s.
wp_nav_menu(array('items_wrap'=> '%3$s', 'walker' => new Nav_Footer_Walker(), 'container'=>false, 'menu_class' => '', 'theme_location'=>'footer', 'fallback_cb'=>false ));
?>

element stream to ts

  • ffmpeg -i audio.aac -i ch2.h264 -acodec copy -vcodec copy -f mpegts out.ts

rtsp 2 rtmp

  • ffmpeg -rtsp_transport tcp -i rtsp://fuck.com/fuck/fuck -c copy -f flv rtmp://shit.com/shit/shit

截图片

  • ./ffmpeg -y -err_detect ignore_err -i "rtmp://uplive.b0.upaiyun.com/live/loading timeout=10" -f image2 -vframes 1 a.jpg
  • ./ffmpeg -y -err_detect ignore_err -i "rtmp://uplive.b0.upaiyun.com/live/loading live=1 timeout=10" -f image2 -vframes 1 a.jpg
@catalsdevelop
catalsdevelop / gist:45fb1c86a6b09450a6cedf3c1550f717
Created May 25, 2017 01:57 — forked from johnrees/gist:b116e426bc73040876c0
streaming desktop to rtmp using ffmpeg
$ git clone https://github.com/iizukanao/node-rtsp-rtmp-server
$ coffee -c .
$ node server.js
$ ffmpeg -f avfoundation -i "0" -vcodec libx264 -tune zerolatency -s 320x480 -vf crop=320:480:0:0 -f flv rtmp://0.0.0.0/live/desktop
# stream on ios device
$ git clone https://github.com/iMoreApps/ffmpeg-avplayer-for-ios-tvos
$ open AVPlayerDemo.xcodeproj (change rtmp stream to rtmp://<LOCAL_IP>/live/desktop, build and run)
@catalsdevelop
catalsdevelop / sequelize-schema-file-generator.js
Created July 6, 2017 02:20 — forked from ahelord/sequelize-schema-file-generator.js
Automatically generates migration files from your sequelize models
'use strict';
//////////////////////////////////
// How to use?
// 1. Create `sequelize-schema-file-generator.js` in your app root
// 2. Make sure you've ran the `sequelize init` before (It should create `config`,`seeders`,`migrations` folders).
// 3. Update `DATABASE_DSN` below to match your connection string (works with any database adapter that Sequelize supports)
// 4. Run it with `node sequelize-schema-file-generator.js`
// 5. Review the generated migrations inside of the `migrations` folder.
//////////////////////////////////
@catalsdevelop
catalsdevelop / elixirphoenix.bash
Created July 9, 2017 12:18 — forked from likethesky/elixirphoenix.bash
Installing Elixir & the Phoenix framework with Homebrew on OS X
$ brew update && brew doctor # Repeat, until you've done *all* the Dr. has ordered!
$ brew install postgresql # You'll need postgres to do this... you may also need to 'initdb' as well. Google it.
$ brew install elixir
$ mix local.hex # Answer y to any Qs
$ createuser -d postgres # create the default 'postgres' user that Chris McCord seems to like -- I don't create mine w/a pw...
# Use the latest Phoenix from here: http://www.phoenixframework.org/docs/installation -- currently this is 1.0.3
# ** Answer y to any Qs **
$ mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.0.3/phoenix_new-1.0.3.ez