Skip to content

Instantly share code, notes, and snippets.

View BrettSheleski's full-sized avatar

Brett Sheleski BrettSheleski

View GitHub Profile
@BrettSheleski
BrettSheleski / ViewModel.cs
Last active November 6, 2019 04:40
A slightly more robust ViewModel base class for Xamarin.Forms
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace MyApp // rename this!!
{
public class ViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
@BrettSheleski
BrettSheleski / ViewModel.cs
Last active October 30, 2019 18:30
a simple Xamarin.Forms ViewModel base class example
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace MyApp // Change this namespace to match your app
{
public abstract class ViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
@BrettSheleski
BrettSheleski / merge-video-multiple-audio.sh
Created February 27, 2019 14:18
ffmpeg map video and multiple audio tracks to single video with multiple audio streams
ffmpeg -i video.mp4 -i audio1.wav -i audio2.wav -map 0 -map 1 -map 2 -vcodec copy -strict experimental out.mp4
@BrettSheleski
BrettSheleski / chapterdb2ffmpegmetadata.xsl
Last active December 17, 2018 17:31
XSLT for converting chapters from Chapterdb.org to ffmpeg metadata
<?xml version="1.0"?>
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cg="http://jvance.com/2008/ChapterGrabber">
<xsl:output method="text" version="1.1" encoding="utf-8" omit-xml-declaration="yes" indent="no"/>
<xsl:template match="/results">
<xsl:apply-templates select="cg:chapterInfo[1]" />
</xsl:template>
@BrettSheleski
BrettSheleski / movienamer
Created December 1, 2018 05:24
Script for renaming/moving a movie file (and leaves symlink behind)
#!/bin/bash
INFILE="$1"
OUTDIR="$2"
INFILENAME=$(basename -- "$INFILE")
INEXTENSION="${INFILENAME##*.}"
RANK_THRESHOLD=0.95