Skip to content

Instantly share code, notes, and snippets.

View lux's full-sized avatar

John Luxford lux

View GitHub Profile
@edjdavid
edjdavid / file.md
Created October 13, 2022 12:45
Stream Windows webcam/desktop via RTSP

Can be used for streaming data (webcam or screen capture) from the Windows to WSL

Install

  1. Simple RTSP Server
  2. ffmpeg

Get the internal IP of WSL

Run from a WSL terminal

ip route list default | awk '{print $3}'
@davidfoster
davidfoster / KalmanFilterFloat.cs
Last active May 5, 2024 14:49
Simple Kalman filtering in Unity.
using System.Collections.Generic;
/// <summary>A Kalman filter implementation for <c>float</c> values.</summary>
public class KalmanFilterFloat {
//-----------------------------------------------------------------------------------------
// Constants:
//-----------------------------------------------------------------------------------------
public const float DEFAULT_Q = 0.000001f;
@lux
lux / gif-to-mp4.sh
Created January 9, 2018 15:59
Quick script ot convert a folder of gifs to mp4 with web-optimal settings (note: requires ffmpeg)
#!/bin/bash
for i in *.gif; do
ffmpeg -i "$i" -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" "${i%.*}.mp4";
done
@jbroadway
jbroadway / Delegates and yielding in Unity.md
Created August 7, 2016 22:49
Delegates and yielding in Unity

Delegates and yielding in Unity

I discovered something interesting in C#'s event delegate system when combined with coroutines.

First, I started with a simple event delegate example:

using UnityEngine;
using System.Collections;
@revolunet
revolunet / create-wav-from-buffer.js
Last active January 29, 2022 14:01
web audio + wav buffering
/*
Goal : instantly play any wav source without download the file and without <audio/>
Idea is to use the fetch streaming API and pass raw data to web audio
My use case is playng a wav file
following http://stackoverflow.com/questions/38589614/webaudio-streaming-with-fetch-domexception-unable-to-decode-audio-data/38593356#38593356
@StagPoint
StagPoint / QuaternionCompression.cs
Last active May 3, 2024 22:23
C# - Use "smallest three" compression for transmitting Quaternion rotations in Unity's UNET networking, from 16 bytes to 7 bytes.
// Copyright (c) 2016 StagPoint Software
namespace StagPoint.Networking
{
using System;
using UnityEngine;
using UnityEngine.Networking;
/// <summary>
/// Provides some commonly-used functions for transferring compressed data over the network using
@DashW
DashW / ScreenRecorder.cs
Last active May 6, 2024 10:27
ScreenRecorder - High Performance Unity Video Capture Script
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading;
class BitmapEncoder
{
public static void WriteBitmap(Stream stream, int width, int height, byte[] imageData)
@erichrobinson
erichrobinson / README.md
Last active February 24, 2024 08:32
SwitchResX Configuration

#SwitchResX Settings for LG 21:9 UltraWide

SwitchResX is a utility that allows users to override the default resolution settings in OSX. For more information, including download links, vist http://www.madrau.com/ .

##Disabling System Integrity Protection (SIP)

If you are running OSX 10.11 or higher, SIP must be disabled. To disable SIP do the following:

  • Boot into the recovery partition by pressing CMD + R when starting up your Mac.
  • Once in recovery mode, open a terminal window.
  • Type the command csrutil disable
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Collections.Generic;
public class SSEvent {
public string Name { get; set; }
public string Data { get; set; }