Skip to content

Instantly share code, notes, and snippets.

View ctaggart's full-sized avatar

Cameron Taggart ctaggart

View GitHub Profile
@ctaggart
ctaggart / paket.targets
Created September 29, 2014 15:55
paket.targets using MSBuildThisFileDirectory https://github.com/fsprojects/Paket/issues/172
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>
<!-- Download Paket.exe if it does not already exist -->
<DownloadPaket Condition=" '$(DownloadPaket)' == '' ">true</DownloadPaket>
@ctaggart
ctaggart / aspnetmaster.txt
Created November 8, 2014 03:26
aspnetvnext & aspnetmaster 2014-11-07
https://www.myget.org/gallery/aspnetmaster
https://www.myget.org/F/aspnetmaster/api/v2
PM> Get-Package -ListAvailable -IncludePrerelease
Id Version Description/Release Notes
-- ------- -------------------------
CoreCLR 1.0.0-alpha4 Core CLR Runtime for all platforms
EntityFramework 7.0.0-alpha4 EntityFramework
EntityFramework.AzureTableS... 7.0.0-alpha4 EntityFramework.AzureTableStorage
GET http://s7:27413/octokit/octokit.net/d0fffd4f7ccc5b72b46b4774df4f2c53a04930ef/Octokit/Http/ProductHeaderValue.cs HTTP/1.1
Accept-Encoding: gzip
User-Agent: Microsoft-Symbol-Server/6.3.9600.17095
Host: s7:27413
Connection: Keep-Alive
Pragma: no-cache
@ctaggart
ctaggart / Program.fs
Created November 14, 2014 23:05
use SourceLink.SymbolCache 0.5
module Program
open System.IO
open SourceLink
open SourceLink.SymbolStore
let printPdbDocuments() =
let a = @"..\..\..\packages\SourceLink\lib\net45\SourceLink.pdb"
use s = File.OpenRead a
@ctaggart
ctaggart / Program.fs
Created November 23, 2014 04:17
SourceLink.SymbolStore example
open System
open System.IO
open SourceLink
open SourceLink.SymbolStore
open System.Reflection
let printfn format = Printf.ksprintf (fun message -> System.Diagnostics.Debug.WriteLine message) format
let pdbFcs = @"..\..\packages\FSharp.Compiler.Service.0.0.76\lib\net45\FSharp.Compiler.Service.pdb"
let dllFcs = @"..\..\packages\FSharp.Compiler.Service.0.0.76\lib\net45\FSharp.Compiler.Service.dll"
@ctaggart
ctaggart / attempts.fs
Last active August 29, 2015 14:11
F# generics and overloads, oh my!
// attempted to add generic contraints
member inline x.AddWithOption<'T when 'T: not struct and 'T : null and 'T :> Object> (nm, op:Option<'T>) = x.AddWithValue (nm, toObj op) // Reference Types
member inline x.AddWithOption<'T when 'T: struct and 'T : (new : unit -> 'T) and 'T :> ValueType> (nm, op:Option<'T>) = x.AddWithValue (nm, toNullable op) // Value Types
// attempted C# style extension
// http://blogs.msdn.com/b/fsharpteam/archive/2013/06/27/announcing-a-pre-release-of-f-3-1-and-the-visual-f-tools-in-visual-studio-2013.aspx
[<Runtime.CompilerServices.Extension>]
static member inline AddWithOption (x:SqlParameterCollection, nm, op:Option<_>) = x.AddWithValue (nm, toObj op) // Reference Types
@ctaggart
ctaggart / FSharp.Core.txt
Last active August 29, 2015 14:12
FSharp.Core Public Surface Area
namespace Microsoft.FSharp.Reflection
/// Represents a case of a discriminated union type
[<Sealed>]
[<Class>]
type UnionCaseInfo =
/// The type in which the case occurs.
member DeclaringType : Type
@ctaggart
ctaggart / 3.0.fsi
Last active August 29, 2015 14:12
FSharp.Core Surface Area
namespace Microsoft.FSharp.Reflection
/// Represents a case of a discriminated union type
[<Sealed>]
[<Class>]
type UnionCaseInfo =
/// The type in which the case occurs.
member DeclaringType : Type
@ctaggart
ctaggart / 3.0 to 3.1.fsi
Created December 27, 2014 02:13
FSharp.Core Surface Area Diff (what is new)
[<AutoOpen>]
module Microsoft.FSharp.Reflection.FSharpReflectionExtensions
/// Creates an instance of a record type.
val MakeRecord : recordType:Type * values:obj [] * ?allowAccessToPrivateRepresentation:bool -> obj
/// Reads all the fields from a record value.
val GetRecordFields : record:obj * ?allowAccessToPrivateRepresentation:bool -> obj []
/// Precompute a function for reading all the fields from a record. The fields are returned in the
@ctaggart
ctaggart / App.fs
Created January 16, 2015 06:28
Format TypeScript with F#
module App
// an F# wrapper for the TypeScript module
module tsast =
open EdgeJs
let format (ts:string): Async<string> =
let f =
Edge.Async
"""