Skip to content

Instantly share code, notes, and snippets.

@mattli001
mattli001 / client.html
Created April 13, 2016 03:41 — forked from ericremoreynolds/client.html
Flask-socket.io emit to specific clients
<html>
<body>
<h1>I feel lonely</h1>
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.16/socket.io.min.js"></script>
<script type="text/javascript" charset="utf-8">
var socket = io.connect('http://' + document.domain + ':' + location.port);
socket.on('connect', function() {
socket.emit('connected');
@mattli001
mattli001 / git_find_largefiles.sh
Created August 30, 2016 03:41
find large files in this git.
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
@mattli001
mattli001 / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Created September 10, 2016 00:24 — forked from Brainiarc7/VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

@mattli001
mattli001 / provider.hlsjs.js
Created March 15, 2017 06:24
provider.hlsjs.js
webpackJsonpjwplayer([1], {
13: function(e, t, r) {
var i, a;
i = [r(1), r(14), r(2), r(19), r(18)], a = function(e, t, r, i, a) {
function n(t) {
if (this._currentTextTrackIndex = -1, t) {
if (this._textTracks ? (this._textTracks = e.reject(this._textTracks, function(e) {
if (this.renderNatively && "nativecaptions" === e._id) return delete this._tracksById[e._id], !0
}, this), delete this._tracksById.nativemetadata) : this._initTextTracks(), t.length) {
var i = 0,
@mattli001
mattli001 / qdk2_list.txt
Created March 16, 2017 01:42
qdk2 file list
dpkg -L qdk2
/.
/etc
/etc/bash_completion.d
/etc/bash_completion.d/qdk2
/usr
/usr/bin
/usr/bin/qpkg_encrypt
/usr/bin/qdk2
/usr/share
@mattli001
mattli001 / calc_downsize.go
Created April 13, 2017 10:09
calc downsize of video resolution
package main
import "fmt"
// Calculates scaling factors using old and new image dimensions.
func calcFactors(width, height uint, oldWidth, oldHeight float64) (scaleX, scaleY float64) {
if width == 0 {
if height == 0 {
scaleX = 1.0
scaleY = 1.0
@mattli001
mattli001 / ffmpeg_test.go
Created May 19, 2017 01:56
golang test ffmpeg example
package ffmpeg
import (
"bytes"
"context"
"io"
"os"
"os/exec"
"strings"
"testing"
[~] # docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9d925e70b634 bmwshop/caffe-rpi:latest "/bin/bash" 39 minutes ago Up 38 minutes caffe-rpi-1
[~] # docker exec -ti caffe-rpi-1 bash -c "make run test"
root@9d925e70b634:/caffe# pwd
/caffe
root@9d925e70b634:/caffe# make runtest
.build_release/tools/caffe
caffe: command line brew
usage: caffe <command> <args>
FROM armv7/armhf-ubuntu
RUN apt-get update && apt-get -y upgrade && apt-get install -y build-essential cmake git pkg-config libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libatlas-base-dev
RUN apt-get install -y --no-install-recommends libboost-all-dev
RUN apt-get install -y libgflags-dev libgoogle-glog-dev liblmdb-dev
# (Python general)
RUN apt-get install -y python-pip
FROM ubuntu:16.04
LABEL maintainer caffe-maint@googlegroups.com
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
wget \
unzip \
libatlas-base-dev \