This file contains hidden or 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 topRouter = scope { | |
pipe_through headerPipe | |
not_found_handler (text "404") | |
get "/" helloWorld | |
get "/a" helloWorld2 | |
getf "/name/%s" helloWorldName | |
getf "/name/%s/%i" helloWorldNameAge | |
//scopes can be defined inline to simulate `subRoute` combinator |
This file contains hidden or 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 fizzBuzz x = | |
match x with | |
| _ when (x % 15) = 0 -> "FizzBuzz" | |
| _ when (x % 3) = 0 -> "Fizz" | |
| _ when (x % 5) = 0 -> "Buzz" | |
| _ -> "" | |
let fizzBuzzTo max = | |
[1..max] | |
|> List.iter (fun number -> printfn "%d %s" number (fizzBuzz number)) |
This file contains hidden or 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
// imports | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { FormsModule } from '@angular/forms'; | |
import { HttpClientModule } from '@angular/common/http'; | |
import { AppComponent } from './app.component'; | |
import { ItemDirective } from './item.directive'; | |
This file contains hidden or 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
import { Component } from '@angular/core'; | |
import { Hero } from './hero'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './Component.html', | |
styleUrls : ['./Component.css'] | |
}) | |
export class AppComponent { |
This file contains hidden or 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
<h1>{{title}}</h1> | |
<h2>My favorite hero is: {{myHero.name}}</h2> | |
<p>Heroes:</p> | |
<ul> | |
<li *ngFor="let hero of heroes"> | |
{{ hero.name }} | |
</li> | |
</ul> | |
<p *ngIf="heroes.length > 3">There are many heroes!</p> |
This file contains hidden or 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
.flex-container { | |
display: flex; | |
flex-wrap: nowrap; | |
background-color: DodgerBlue; | |
} | |
.flex-container > div { | |
background-color: #f1f1f1; | |
width: 100px; | |
margin: 10px; |
This file contains hidden or 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
#r "../../../bin/lib/net45/FSharp.Data.dll" | |
#load "../../../packages/test/FSharp.Charting/FSharp.Charting.fsx" | |
open FSharp.Data | |
open FSharp.Charting | |
type WorldBank = WorldBankDataProvider<"World Development Indicators", Asynchronous=true> | |
let wb = WorldBank.GetDataContext() |
This file contains hidden or 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
class Person { | |
private readonly string firstName; | |
private readonly string lastName; | |
public Person(string firstName, string lastName) { | |
this.firstName = firstName; | |
this.lastName = lastName; | |
} | |
public string FirstName { get {return this.firstName; } } | |
public string LastName { get {return this.lastName; } } |
This file contains hidden or 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 Person(firstName:string, lastName: string) = | |
let firstName = firstName | |
let lastName = lastName | |
let calculateFullName() = | |
firstName + " " + lastName | |
member x.FirstName with get() = firstName | |
member x.LastName with get() = lastName | |
member x.FullName with get() = calculateFullName() |
This file contains hidden or 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 Person = { | |
FirstName : string | |
LastName : string | |
} | |
with | |
member x.FullName() = | |
x.FirstName + " " + x.LastName |