This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.myValidIcon | |
{ | |
width : 20px; | |
height : 20px; | |
background-color: Green; | |
} | |
.myErrorIcon | |
{ | |
width : 20px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let options = new MapOptions(8, center, MapTypeId.ROADMAP) | |
let map = new Google.Maps.Map(mapElement.Body, options) | |
// Create the marker | |
let markerOption = new MarkerOptions(center) | |
markerOption.Map <- map | |
let marker = new Marker(markerOption) | |
// Function for setting mark the lat/long. | |
let setLatLong (latLong: LatLng) = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type UserInfo = { Name: string; Email : string} | |
module Server = | |
[<Rpc>] | |
let GetUsers () = | |
Db.GetUsers // Your db call | |
|> Seq.map (fun u -> | |
{ | |
Name = u.Name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Formlet.Do { | |
let! x = Controls.RadioButtonGroup None [("item1","item1");("item2","item2");("item3","item3")] | |
return x | |
} | |
|> Formlet.Map Some | |
|> Formlet.InitWith None | |
|> Enhance.WithSubmitAndResetButtons | |
|> Enhance.WithFormContainer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open M | |
Foo () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[<JavaScript>] | |
let InputDate () = | |
let inputId = NewId () | |
Controls.InputDatepicker None | |
|> Formlet.MapElement (fun el -> Div [Attr.Id inputId] -< [el]) | |
|>! OnAfterRender (fun el -> | |
JQuery.JQuery.Of("#" + inputId).Find("input").Val("").Ignore | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type MyControl() = | |
inherit IntelliFactory.WebSharper.Web.Control () | |
[<JavaScript>] | |
override this.Body = | |
let inpCtrl str = | |
Controls.Input str | |
|> Enhance.WithSubmitButton | |
|> Enhance.WithFormContainer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var createCounter = function() { | |
var x = 0; | |
return ( | |
function () { | |
x = x + 1; | |
return x; | |
} | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Formlet.Do { | |
let! n = Controls.Button "Add Tabs" | |
return! | |
List.init n (fun ix -> | |
("Tab " + string ix, Controls.Input "") | |
) | |
|> Controls.TabsChoose | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Collections.Generic | |
// The problem I'm addressing is aggregating elements from a tree. | |
// In my particular scenario I'm interested in collecting all leaf nodes | |
// into an array. The fundamental problem is captured by the different versions | |
// of aggregate, listed below. The functions are merely simulating the branching | |
// and aggregation steps. I'm not concerned about the order of the elements. | |
// In the comments are the total times in milliseconds | |
// running the functions with n = 1e6. That is generating an array of roughly |
OlderNewer