Skip to content

Instantly share code, notes, and snippets.

View UpdateGitHubBranch.cs
using Octokit;
using System;
using System.Threading.Tasks;
using System.Diagnostics;
namespace UpdateGitHub
class Program
swlaschin /
Last active Sep 20, 2021
Effective F#, tips and tricks


  • Use Onion architecture

    • Dependencies go inwards. That is, the Core domain doesn't know about outside layers
  • Use pipeline model to implement workflows/use-cases/stories

    • Business logic makes decisions
    • IO does storage with minimal logic
    • Keep Business logic and IO separate
    • Keep IO at edges
punker76 / MainWindow.xaml
Created Feb 6, 2019
Detecting Windows 10 Dark/Light mode
View MainWindow.xaml
<Window x:Class="WpfApp1.MainWindow"
Title="MainWindow" Height="450" Width="800">

Windows Setup Notes

based on original document from Alan Stevens



  • Install using Local Account first, attach Microsoft account later
realvictorprm / PaketDependencyManagementMadeEasy.fsx
Last active Jun 12, 2018
A must have for your script file to ease spreading a small proof of concept with dependencies!
View PaketDependencyManagementMadeEasy.fsx
open System
open System.IO
open System.Diagnostics
let downloadDependencies deps =
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
if not (File.Exists "paket.exe") then
async {
let url = ""
bslatner / ExampleCall.fs
Last active Nov 12, 2017
Code for making rest API requests in F# using the RestSharp library
View ExampleCall.fs
// StartResult would be the type of the response. Must be marked with [<CLIMutable>]
let response =
restWithResponse<StartResult> (
POST >> toResource "stopwatch/{type}/{key}/start" >> atUrl config.Url
>> withUrlSegment "type" stopwatchType
>> withUrlSegment "key" key
>> withFormValue "owner" owner
>> withExpectedStatusOk

This guide was created using Microsoft Windows 10 Pro

Version 10.0.17134 Build 17134


System Updates:

  • Settings -> Update & Security
  • Install all updates

Powershell Execution Policy:

  • launch Windows Powershell as administrator and execute:
jessfraz / boxstarter.ps1
Last active Sep 23, 2021
Boxstarter Commands for a new Windows box.
View boxstarter.ps1
# Description: Boxstarter Script
# Author: Jess Frazelle <>
# Last Updated: 2017-09-11
# Install boxstarter:
# . { iwr -useb } | iex; get-boxstarter -Force
# You might need to set: Set-ExecutionPolicy RemoteSigned
# Run this boxstarter by calling the following from an **elevated** command-prompt:
RickStrahl / DebounceDispatcher.cs
Last active Sep 3, 2020
Debouncing events by a timeout using a Dispatcher.
View DebounceDispatcher.cs
public class DebounceDispatcher
private DispatcherTimer timer;
public void Debounce(int timeout, Action<object> action,
object param = null,
DispatcherPriority priority = DispatcherPriority.ApplicationIdle,
Dispatcher disp = null)
if (disp == null)
ploeh / Tuple2.fs
Last active Sep 8, 2020
Helpful functions for working with pairs in F#
View Tuple2.fs
module Tuple2
let replicate x = x, x
let curry f x y = f (x, y)
let uncurry f (x, y) = f x y
let swap (x, y) = (y, x)