Skip to content

Instantly share code, notes, and snippets.

View jwosty's full-sized avatar

John Wostenberg jwosty

View GitHub Profile
@jwosty
jwosty / harmless
Last active September 23, 2016 22:16
true
@jwosty
jwosty / stuff.fsx
Last active September 25, 2016 23:14
let rec pairs list =
match list with
| [] -> []
| x::ys -> [for y in ys -> x, y] @ pairs ys
pairs [1..4]
let rec pairslc list = [
match list with
| [] -> ()
@jwosty
jwosty / stuff2.fsx
Last active September 25, 2016 23:14
let rec genPairs list =
match list with
| [] -> []
| x::ys -> [for y in ys -> x, y] @ genPairs ys
let items = ["joe"; "jim"; "jack"; "jud"]
let r = new System.Random()
let shuffle cards = cards |> List.map (fun card -> r.Next(),card) |> List.sort |> List.map snd
items |> shuffle
module SecretSanta
open System
//let initConsole () =
// let clrstr = String.replicate Console.BufferWidth " "
// for _ in 1 .. Console.WindowHeight do
// Console.WriteLine clrstr
//let clearConsole () =
//Console.SetCursorPosition (0, 0)
open System
open System.IO
open System.Text
let tryReadFile path = async {
if File.Exists path then
use file = File.OpenRead path
let! bytes = file.AsyncRead (int file.Length)
return Some (Encoding.UTF8.GetString bytes)
else return None }
<!--
============================================================================================================================================
/Users/jwostenberg/Code/FSharp/visualfsharp/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj
============================================================================================================================================
-->
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<FSharpSourcesRoot>$(MSBuildProjectDirectory)\..\..</FSharpSourcesRoot>
</PropertyGroup>
INFO [2018-04-02 11:12:33Z]: Starting Visual Studio 2017 for Mac 7.4.1 (build 48)
INFO [2018-04-02 11:12:33Z]: Running on Mono 5.8.1.0 (2017-10/6bf3922f3fd) (64-bit)
INFO [2018-04-02 11:12:33Z]: Operating System: Mac OS X 10.13.3
Darwin 17.4.0 Darwin Kernel Version 17.4.0
Sun Dec 17 09:19:54 PST 2017
root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64
INFO [2018-04-02 11:12:34Z]: GTK: Using gtkrc from /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/gtkrc.mac-dark
Could not find `Microsoft.Build.Framework` referenced by assembly `MonoDevelop.Core, Version=2.6.0.0, Culture=neutral, PublicKeyToken=3ead7498f347467b`.
Could not find `Microsoft.Build` referenced by assembly `MonoDevelop.Core, Version=2.6.0.0, Culture=neutral, PublicKeyToken=3ead7498f347467b`.
Could not find `Microsoft.Build.Utilities.Core` referenced by assembly `MonoDevelop.Core, Version=2.6.0.0, Culture=neutral, PublicKeyToken=3ead7498f347467b`.
#if run_as_bin_sh
exec fsharpi --quiet --readline- < <(cat $0) -- $*
#endif
// Downloads the paket bootstrapper in magic mode into $PWD/.paket/ .
open System
open System.IO
open System.Net
open System.Text.RegularExpressions
namespace TestAddin
open System
open Mono.Addins
open Mono.Addins.Description
[<assembly: Addin(
"TestAddin",
Namespace = "TestAddin",
Version = "1.0")>]
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restoring packages for /Users/jwostenberg/Code/FSharp/electest/StageForge.Core/StageForge.Core.fsproj...
Restoring packages for /Users/jwostenberg/Code/FSharp/electest/StageForge.Host/StageForge.Host.csproj...
Generating MSBuild file /Users/jwostenberg/Code/FSharp/electest/StageForge.Core/obj/StageForge.Core.fsproj.nuget.g.props.
Generating MSBuild file /Users/jwostenberg/Code/FSharp/electest/StageForge.Core/obj/StageForge.Core.fsproj.nuget.g.targets.
Restore completed in 724.18 ms for /Users/jwostenberg/Code/FSharp/electest/StageForge.Core/StageForge.Core.fsproj.
Generating MSBuild file /Users/jwostenberg/Code/FSharp/electest/StageForge.Host/obj/StageForge.Host.csproj.nuget.g.props.
Generating MSBuild file /Users/jwostenberg/Code/FSharp/electest/StageForge.Host/obj/StageForge.Host.csproj.nuget.g.targets.