Skip to content

Instantly share code, notes, and snippets.

View fiddyschmitt's full-sized avatar

Fidel Perez-Smith fiddyschmitt

  • Brisbane, Australia
View GitHub Profile
@fiddyschmitt
fiddyschmitt / gist:4e49019c8f10b267fb7f3284689f88c4
Last active November 4, 2024 15:56
ffmpeg - send and receive G.711 RTP audio
--list input devices
ffmpeg -list_devices true -f dshow -i dummy
--to record microphone to mp3
ffmpeg -f dshow -i audio="Microphone (Logitech USB Headset H340)" -c:a libmp3lame -ar 44100 -b:a 320k -ac 1 output1.mp3
--send mic to rtp multicast g.711
ffmpeg -f dshow -i audio="Microphone (Logitech USB Headset H340)" -ac 1 -ar 8000 -ab 64 -acodec pcm_mulaw -f rtp rtp://239.0.0.1:5656
--play received audio
var columnFilters = new[]
{
new {SheetName = "Sheet1", ColumnName = "FirstName", Values = new [] { "Bob", "John"}},
new {SheetName = "Sheet1", ColumnName = "Age", Values = new [] { 30"}},
}.ToList();
//Apply filters
using (var pck = new ExcelPackage(new FileInfo(parametricsLogFilename)))
{
columnFilters.ForEach(columnFilter =>
--Using sysinternals
handle.exe -p notepad.exe -nobanner -a \Sessions\1\BaseNamedObjects\SessionImmersiveColorMutex
handle.exe -p 40012 -c 21C -nobanner -y
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <AutoItConstants.au3>
#include <StringConstants.au3>
#include <Array.au3>
Local $processOrPid
Local $mutantName
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <WinAPI.au3>
;~ #include <WinAPIInternals.au3>
#include <Array.au3>
Main()
@fiddyschmitt
fiddyschmitt / gist:3493f4006dd6408d3f5caeb77202bcb1
Created July 28, 2020 03:38
Enable nullable reference types on old projects
using System;
using System.IO;
using System.Linq;
using System.Windows.Forms;
namespace EnableNullableReferenceTypes
{
/*
Add the following to the .csproj file:
public static IEnumerable<T> MaskToList<T>(this Enum mask)
{
if (typeof(T).IsSubclassOf(typeof(Enum)) == false)
throw new ArgumentException();
return Enum.GetValues(typeof(T))
.Cast<Enum>()
.Where(m => mask.HasFlag(m))
.Cast<T>();
}
net use \\YOURCOMPUTERNAMEHERE
QWINSTA /server:YOURCOMPUTERNAMEHERE
LOGOFF YOURSESSIONIDHERE /server:YOURCOMPUTERNAMEHERE
public static string FormatUsingRoslyn(string csCode)
{
var tree = CSharpSyntaxTree.ParseText(csCode);
var root = tree.GetRoot().NormalizeWhitespace();
var result = root.ToFullString();
return result;
}