Skip to content

Instantly share code, notes, and snippets.

@TahaHachana
TahaHachana / gist:2005049
Created March 9, 2012 04:31
Project Interop Sample
#r "Microsoft.Office.Interop.MSProject.dll"
#r "Microsoft.Office.Interop.Excel.dll"
open System
open Microsoft.Office.Interop.MSProject
open Microsoft.Office.Interop.Excel
[<AutoOpenAttribute>]
module ProjectInterop =
@TahaHachana
TahaHachana / HelloCanvas.fs
Created April 6, 2013 08:40
This gist demonstrates how to draw the text "Hello Canvas" on the HTML5 canvas using the WebSharper bindings to this element.
module HelloCanvas =
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.Html
open IntelliFactory.WebSharper.Html5
[<JavaScript>]
let main() =
let element = HTML5.Tags.Canvas [Text "Fallback content goes here."]
let canvas = As<CanvasElement> element.Dom
@TahaHachana
TahaHachana / FillRect.fs
Created April 6, 2013 08:59
This WebSharper code sample draws a blue rectangle on a canvas.
module FillRect =
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.Html
open IntelliFactory.WebSharper.Html5
[<JavaScript>]
let main() =
let element = HTML5.Tags.Canvas [Text "Fallback content goes here."]
let canvas = As<CanvasElement> element.Dom
@TahaHachana
TahaHachana / StrokeRect.fs
Last active December 15, 2015 21:28
This WebSharper code draws a blue outline around a rectangle on a canvas using the StrokeRect method.
module StrokeRect =
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.Html
open IntelliFactory.WebSharper.Html5
[<JavaScript>]
let main() =
let element = HTML5.Tags.Canvas [Text "Fallback content goes here."]
let canvas = As<CanvasElement> element.Dom
@TahaHachana
TahaHachana / ClearRect.fs
Created April 6, 2013 09:18
This WebSharper code draws a black rectangle on the hole canvas surface and then clears a 100px X 100px rectangle starting from the coordinates (50, 50).
module ClearRect =
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.Html
open IntelliFactory.WebSharper.Html5
[<JavaScript>]
let main() =
let element = HTML5.Tags.Canvas [Text "Fallback content goes here."]
let canvas = As<CanvasElement> element.Dom
module FillStyle =
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.Html
open IntelliFactory.WebSharper.Html5
[<JavaScript>]
let main() =
let element = HTML5.Tags.Canvas [Text "Fallback content goes here."]
let canvas = As<CanvasElement> element.Dom
module LineJoin =
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.Html
open IntelliFactory.WebSharper.Html5
[<JavaScript>]
let main() =
let element = HTML5.Tags.Canvas [Text "Fallback content goes here."]
let canvas = As<CanvasElement> element.Dom
module StrokeStyle =
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.Html
open IntelliFactory.WebSharper.Html5
[<JavaScript>]
let main() =
let element = HTML5.Tags.Canvas [Text "Fallback content goes here."]
let canvas = As<CanvasElement> element.Dom
module LinearGradient =
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.Html
open IntelliFactory.WebSharper.Html5
[<JavaScript>]
let main() =
let element = HTML5.Tags.Canvas [Text "Fallback content goes here."]
let canvas = As<CanvasElement> element.Dom
module RadialGradient =
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.Html
open IntelliFactory.WebSharper.Html5
[<JavaScript>]
let main() =
let element = HTML5.Tags.Canvas [Text "Fallback content goes here."]
let canvas = As<CanvasElement> element.Dom