Skip to content

Instantly share code, notes, and snippets.

View ReedCopsey's full-sized avatar

Reed Copsey, Jr. ReedCopsey

View GitHub Profile
@ReedCopsey
ReedCopsey / acme.html
Last active November 3, 2022 17:39
Sample Landing Page Embedding
<html>
<head>
<title>3D Viewer: ACME Site</title>
</head>
<body style="margin: 0px;">
<iframe style="border: none; outline: none; overflow: hidden;" width="100%" height="100%" src="https://viewer.ctech.com/envirofaux.html?title=3D%20Viewer%3A%20ACME%20Site&logo=https%3A%2F%2Fenvirofaux.com%2FACME-EnviroFaux.png" allow="fullscreen"></iframe>
</body>
</html>
12/17/2020 1928 Child in snow
12/17/2020 1929 Child grabbing snow
12/17/2020 1930 Snowball being formed
12/17/2020 1931 Snowball flinging towards tree
12/17/2020 1932 Tree gets hit
12/17/2020 1933 Tree vibrates
12/17/2020 1934 Snow falls off branches
12/17/2020 1935 Snow lands on child and dog
12/17/2020 1936 The dog wimpers, then says "Woof"
12/17/2020 1937 The child hugs dog
@ReedCopsey
ReedCopsey / Seq.fold
Last active December 20, 2019 03:17
F# Looping Sample Code
Seq.fold : ('State -> 'T -> 'State) -> 'State -> seq<'T> -> 'State
@ReedCopsey
ReedCopsey / AvaloniaProgram.fs
Last active December 18, 2018 16:37
FsAdvent 2018 Code
[<STAThread>]
[<EntryPoint>]
let main _ =
let app () =
AppBuilder.Configure<App>().UsePlatformDetect().LogToDebug().SetupWithoutStarting().Instance
let nav = Gjallarhorn.Avalonia.Navigation.singleView app MainWindow
let app' = Program.application nav.Navigate
Gjallarhorn.Avalonia.Framework.RunApplication<Forest,unit,ForestMessage> (nav, app')
@ReedCopsey
ReedCopsey / app.fs
Last active December 15, 2017 05:56
FsAdvent 2017 Code
let application nav =
// Start pruning "loop" via Executor type
let prune = new Executor<_,_>(pruneHandler)
prune.Start()
// Start our application, and attach the executor so messages dispatch to the application
Framework.application Forest.empty Forest.update forestComponent nav
|> Framework.withDispatcher prune
@ReedCopsey
ReedCopsey / test.cs
Created August 31, 2017 18:37
Linqpad C# Program
void Main()
{
IMsg test = new S2("foo", "bar");
switch (test)
{
// How do I simplify this??? I'd like to "match and deconstruct" as a oneliner if possible
case S1 s1:
{
int foo = s1.Data;
@ReedCopsey
ReedCopsey / application.fs
Last active December 15, 2016 20:52
FsAdvent 2016 Code
let application =
// Create our forest, wrapped in a mutable with an atomic update function
let forest = new AsyncMutable<_>(Forest.empty)
// Create our 3 functions for the application framework
// Start with the function to create our model (as an ISignal<'a>)
let createModel () : ISignal<_> = forest :> _
// Create a function that updates our state given a message
@ReedCopsey
ReedCopsey / Manager.fs
Last active December 9, 2015 21:02
FsAdvent Code
type ForestUpdate =
| Add of Tree * Forest
| Decorate of Tree * Forest
type ForestUpdateResult =
| Success of Forest
| Pruned of Forest
| Error of string
module ForestManager =
/// <summary>
/// An <see cref="ICommand"/> whose delegates do not take any parameters for <see cref="Execute"/> and <see cref="CanExecute"/>.
/// </summary>
public class ActionCommand : DelegateCommandBase
{
/// <summary>
/// Initializes a new instance of the <see cref="ActionCommand"/> class with the <see cref="Action"/> to invoke on execution.
/// </summary>
/// <param name="executeMethod">The execute method.</param>
/// <param name="useCommandManager">if set to <c>true</c> use the command manager instead of our own event process for CanExecuteChanged Tracking.</param>
@ReedCopsey
ReedCopsey / RwLock
Last active August 29, 2015 14:15 — forked from JohanLarsson/RwLock
using System;
using System.Threading;
public sealed class RwLock : IDisposable
{
private readonly ReaderWriterLockSlim _innerLock = new ReaderWriterLockSlim();
private bool _disposed = false;
public IDisposable Read()
{