Skip to content

Instantly share code, notes, and snippets.

View Hackmodford's full-sized avatar

Brandon Butler Hackmodford

View GitHub Profile
@Hackmodford
Hackmodford / gist:af28c6ae83908ca2f0fd8aadcfc96a3f
Created October 22, 2021 17:35
readonly BehaviorSubject aka BehaviorObservable
public interface IBehaviorObservable<T> : IObservable<T>
{
T Value { get; }
bool TryGetValue(out T value);
}
/// <summary>
/// Exposes a BehaviorSubject's Value property while hiding the OnNext, OnError, OnComplete methods.
/// </summary>
/// <typeparam name="T">To be added.</typeparam>
@Hackmodford
Hackmodford / IPlatformPhotoService.cs
Created September 17, 2021 13:55
MediaPicker CapturePhotoAsync Rotation Fix
public interface IPhotoService
{
public Task<Stream> TakePhotoAsync(MediaPickerOptions options = null);
}
@Hackmodford
Hackmodford / AVAssetExtensions.cs
Created February 9, 2021 02:39
MNAVChapter C# port attempt
using System.Collections.Generic;
using AVFoundation;
namespace Chapters
{
// ReSharper disable once InconsistentNaming
public static class AVAssetExtensions
{
public static IList<Chapter> GetChapters(this AVAsset asset)
{
@Hackmodford
Hackmodford / ReactiveMvxViewModel.cs
Created January 31, 2021 18:52
A MvxViewModel that works with ReactiveUI
using System;
using System.Threading.Tasks;
using MvvmCross.ViewModels;
using ReactiveUI;
namespace ReactiveUI.Mvx
{
public abstract class ReactiveMvxViewModel : ReactiveObject, IMvxViewModel
{
public virtual void ViewCreated()
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
UITabBarController* tabController = [[UITabBarController alloc] init];