Skip to content

Instantly share code, notes, and snippets.

@raiscui
raiscui / Api.elm
Created May 30, 2017 14:36 — forked from maxhoffmann/Api.elm
Effect Manager for token authentication in Elm
-- Api Effect Manager
effect module Api where { command = MyCmd } exposing (request, Response)
import Task exposing (..)
import Http
import Process
import Json.Decode as Json exposing ((:=))
import Native.Api
const isArray = (a) => {
return (!!a) && (a.constructor === Array);
};
const isObject = (a) => {
return (!!a) && (a.constructor === Object);
};
const gunToObj = (obj,getKey,putKey) => {
getKey = (typeof(getKey) === 'undefined') ? '_title' : getKey;
putKey = (typeof(putKey) === 'undefined') ? 'title' : putKey;
@raiscui
raiscui / install_tensorflow_form_source_Ubuntu_16_04.md
Created November 10, 2017 08:22 — forked from terrydang/install_tensorflow_form_source_Ubuntu_16_04.md
Ubuntu 16.04 安装 tensorflow with GPU support(源码编译安装)

Ubuntu 16.04 安装 tensorflow with GPU support(源码编译安装)

显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]

1. 安装依赖
@raiscui
raiscui / install_nvidia_driver_in_ubuntu1604.md
Created November 10, 2017 08:23 — forked from terrydang/install_nvidia_driver_in_ubuntu1604.md
Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

配有英伟达显卡的主机,装完 Ubuntu 16.04 后出现闪屏现象,是由于没有安装显卡驱动。

显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]

@raiscui
raiscui / callback-to-promise.js
Created January 14, 2018 08:36 — forked from TheDeveloper/callback-to-promise.js
A little function to convert a callback-style function to Promises
// usage: promisify(function([args..., cb]) { /* do stuff with args then cb */ })()
exports.promisify = function(fn) {
return function(...args) {
return new Promise((resolve, reject) => {
fn(...args, (err, result) => {
if (err) return reject(err);
resolve(result);
});
});
};

video subtitle

ffmpeg -i *.mp4 -vf subtitles=*.srt output.mp4

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

截图片

@raiscui
raiscui / gunjstrustsharekey.js
Created August 5, 2019 22:49 — forked from Lightnet/gunjstrustsharekey.js
gunjstrustsharekeyv1.js
/*
Self contain Sandbox Gun Module:
version: 1.0
Created by: Lightnet
Credit: amark ( https://github.com/amark/gun)
License: MIT
@raiscui
raiscui / AvlTree.re
Created August 7, 2019 06:02 — forked from busypeoples/AvlTree.re
Data Structures in ReasonML: #6 AVL Tree
/* AVL Tree */
/* A balanced Binary Search Tree */
exception Undefined;
module type AvlTree = {
type t = int;
type height = int;
type tree('t) =
| Leaf
| Node(height, tree('t), 't, tree('t));
@raiscui
raiscui / Graph.re
Created August 7, 2019 06:09 — forked from busypeoples/Graph.re
Data Structures in ReasonML: #8 Graph
/* Graph */
exception Not_found;
type nodes = list(int);
type edges = list((int, int));
type graph =
| Empty
| Graph(nodes, edges);
@raiscui
raiscui / reason-remote-data.re
Created August 7, 2019 06:11 — forked from busypeoples/reason-remote-data.re
ReasonML port remote-data
/*
remote-data ported to ReasonML
See also https://github.com/krisajenkins/remotedata
Tools for fetching data from remote sources (incl. HTTP).
*/
type remoteData 'e 'a
= NotAsked
| Loading