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
#r "ServiceStack.Text.dll" | |
open System.Net | |
open System.IO | |
open ServiceStack.Text | |
type System.Net.WebRequest with | |
member x.GetResponseAsync() = | |
Async.FromBeginEnd(x.BeginGetResponse, x.EndGetResponse) | |
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
(* Stand-alone HelloWorld ServiceStack Web Service with F# on Mono/Windows using HttpListener | |
INFO: and C#/ASP.NET HelloWorld example at: http://servicestack.net/ServiceStack.Hello/ | |
Instructions: | |
1) download https://github.com/ServiceStack/ServiceStack/downloads | |
2) fsharpc -r:ServiceStack.Common.dll -r:ServiceStack.Interfaces.dll -r:ServiceStack.Text.dll -r:ServiceStack.dll FSharpStack.fs | |
3) sudo mono FSharpStack.exe | |
*) | |
open System |
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
(* Stand-alone Twitter API ServiceStack Web Service with F# on Mono/Windows using HttpListener | |
Instructions: | |
1) download https://github.com/ServiceStack/ServiceStack/downloads | |
2) fsharpc -r:ServiceStack.Common.dll -r:ServiceStack.Interfaces.dll -r:ServiceStack.Text.dll -r:ServiceStack.dll FTweetStack.fs | |
3) sudo mono FTweetStack.exe | |
*) | |
open System | |
open System.IO |
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
using System; | |
namespace FastIsraelTaxCalculator | |
{ | |
class MainClass | |
{ | |
static readonly string[] DefaultAmounts = new[] { "5000", "5800", "9000", "15000", "50000" }; | |
public static void Main (string[] args) | |
{ |
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
(* Stand-alone Twitter API ServiceStack Web Service with F# on Mono/OSX hosted by HttpListener | |
Instructions: | |
1) download https://github.com/ServiceStack/ServiceStack/downloads | |
2) fsharpc -r:ServiceStack.Common.dll -r:ServiceStack.Interfaces.dll -r:ServiceStack.Text.dll -r:ServiceStack.dll FTweetStack.fs | |
3) sudo mono FTweetStack.exe | |
*) | |
open System | |
open ServiceStack.ServiceHost |
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
(* http://www.simontylercousins.netsolution to http://ayende.com/blog/108545/the-tax-calculation-challenge *) | |
let taxes salary = | |
let rates = [ | |
40230.0m,0.45m; | |
21240.0m,0.33m; | |
14070.0m,0.3m; | |
8660.0m,0.23m; | |
5070.0m,0.14m; | |
0.0m,0.1m] |
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
(* Stand-alone Hello World ServiceStack Web Service with F# on Mono/OSX hosted by HttpListener | |
Instructions: | |
1) download https://github.com/ServiceStack/ServiceStack/downloads | |
2) fsharpc -r:ServiceStack.Common.dll -r:ServiceStack.Interfaces.dll -r:ServiceStack.Text.dll -r:ServiceStack.dll Hello.fs | |
3) sudo mono Hello.exe | |
Read More: For the benefits of a ServiceStack Hello World Service see: http://www.servicestack.net/ServiceStack.Hello/ | |
*) |
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
<%@ Application Inherits="HelloFSharp.Global" %> |
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
(* F# Twitter API ServiceStack ASP.NET Web Service on Windows/Mono/OSX | |
Instructions: | |
1) download https://github.com/ServiceStack/ServiceStack/downloads | |
2) fsharpc -r:ServiceStack.Common.dll -r:ServiceStack.Interfaces.dll -r:ServiceStack.Text.dll -r:ServiceStack.dll --target:library FTweetStackAsp.fs | |
3) mkdir bin && cp *.dll bin | |
4) echo "<%@ Application Inherits=\"FTweetStack.Global\" %>" >> Global.asax | |
5) copy Web.config mappings from http://www.servicestack.net/ServiceStack.Hello/ | |
6) xsp4 | |
*) |
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
using System; | |
using Funq; | |
using ServiceStack.Common; | |
using ServiceStack.Common.Web; | |
using ServiceStack.Service; | |
using ServiceStack.ServiceClient.Web; | |
using ServiceStack.ServiceHost; | |
using ServiceStack.ServiceInterface.ServiceModel; | |
using ServiceStack.Text; | |
using ServiceStack.WebHost.Endpoints; |