Skip to content

Instantly share code, notes, and snippets.

@embix
embix / ffmpeg4matelight.sh
Created February 17, 2016 22:46 — forked from MichaelKreil/ffmpeg4matelight.sh
using ffmpeg to stream videos, gifs, the webcam or the screen to matelight
# Stream a video
ffmpeg -re -i video.avi -vf "scale=40:ih*40/iw, crop=40:16" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337
# Loop a gif
ffmpeg -re -ignore_loop 0 -i image.gif -vf "scale=40:ih*40/iw, crop=40:16" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337
# Stream webcam
# Mac
ffmpeg -re -f avfoundation -r 30 -s 1280x720 -i "0" -vf "scale=40:ih*40/iw, crop=40:16, pp=autolevels:f, eq=1.5" -f rawvideo -vcodec rawvideo -sws_flags bilinear -pix_fmt rgb24 - > /dev/udp/matelight.cbrp3.c-base.org/1337
@embix
embix / install_ffmpeg_ubuntu.sh
Created July 16, 2016 14:48 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
git clone 'ext::ssh -i ~/.ssh/github_rsa tfs.bananensoftware.com %S /tfs/PublicTeamProjectCollection/Evaluations/_git/TfsSshEvaluation'
@embix
embix / git-aliases.md
Created September 1, 2016 06:10 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@embix
embix / ExternalReferenceLinksProviderComponent.cs
Created May 4, 2017 20:37 — forked from ZimM-LostPolygon/ExternalReferenceLinksProviderComponent.cs
A simple SandCastle BuildComponent for replacing unknown type references with links from XML database
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition.Hosting;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Linq;
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\exefile\shell\Decompile with dnSpy]
[HKEY_CLASSES_ROOT\exefile\shell\Decompile with dnSpy\command]
@="\"C:\\Tools\\dnSpy\\dnSpy.exe\" \"%1\""
[HKEY_CLASSES_ROOT\dllfile\shell\Decompile with dnSpy]
[HKEY_CLASSES_ROOT\dllfile\shell\Decompile with dnSpy\command]
@embix
embix / YoutubeApiV3Spike.linq.cs
Created May 23, 2017 20:50
qnd youtube api v3 video duration stats
/*
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\System.Net.Http.dll</Reference>
<NuGetReference>Google.Apis.YouTube.v3</NuGetReference>
<Namespace>Google.Apis.Auth.OAuth2</Namespace>
<Namespace>Google.Apis.YouTube.v3</Namespace>
<Namespace>Google.Apis.Services</Namespace>
<Namespace>System.Threading.Tasks</Namespace>
<Namespace>Google.Apis.YouTube.v3.Data</Namespace>
</Query>
@embix
embix / SimpleHTTPServer.cs
Created November 8, 2017 19:23 — forked from aksakalli/SimpleHTTPServer.cs
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;
<Query Kind="FSharpProgram">
<NuGetReference>Suave</NuGetReference>
</Query>
open System
open System.Net
open System.Threading
open Suave
[<EntryPoint>]
// c# companion script
// SpriteUVToShader.cs -------------------------------------------------------------------------------------------------------------------------------- //
// Save you your project, add to your SpriteRenderer gameObject
using UnityEngine;
using System.Collections;
using System.Collections.Generic;