Skip to content

Instantly share code, notes, and snippets.

View myty's full-sized avatar
👋
Hi

Michael Tyson myty

👋
Hi
View GitHub Profile
@aspnetde
aspnetde / mvu.tsx
Created September 6, 2020 22:23
Pragmatic MVU With React And TypeScript
import React, { useReducer } from "react";
interface State {
userName: string;
password: string;
isValid: boolean;
}
const initialState: State = {
userName: "",
@davidfowl
davidfowl / dotnetlayout.md
Last active July 22, 2024 09:49
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@bennage
bennage / alias.cs
Created March 10, 2014 23:10
making tuples a little easier to work with
namespace AliasFun
{
using MyRecord = System.Tuple<string, int>;
public class AnExample
{
public void Demonstrating()
{
var record = new MyRecord("thing", 42);
}
@hickford
hickford / buffer-until-calm.cs
Created March 29, 2012 21:32
BufferUntilCalm method for .NET's Reactive Extensions
public static class ObservableExtensions
{
/// <summary>
/// Group observable sequence into buffers separated by periods of calm
/// </summary>
/// <param name="source">Observable to buffer</param>
/// <param name="calmDuration">Duration of calm after which to close buffer</param>
/// <param name="maxCount">Max size to buffer before returning</param>
/// <param name="maxDuration">Max duration to buffer before returning</param>
public static IObservable<IList<T>> BufferUntilCalm<T>(this IObservable<T> source, TimeSpan calmDuration, Int32? maxCount=null, TimeSpan? maxDuration = null)