Skip to content

Instantly share code, notes, and snippets.

View qwe2's full-sized avatar

István Gansperger qwe2

View GitHub Profile
@qwe2
qwe2 / RpcTest.fs
Created February 9, 2015 13:54
RPC Test
namespace RPCTest
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.JavaScript
open IntelliFactory.WebSharper.Html.Client
[<JavaScript>]
type RpcResult<'T> =
| Success of 'T
| Error of string
@qwe2
qwe2 / ClipboardEventExt.fs
Created February 24, 2015 11:26
ClipboardEvent partial extension
namespace ClipboardEventExtension
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.InterfaceGenerator
module Definition =
let ClipboardEventType =
Pattern.EnumStrings "ClipboardEventType" [ "copy"; "cut"; "paste" ]
@qwe2
qwe2 / README.md
Last active August 29, 2015 14:16
CloudSharper local component starter for Chrome on Windows
  • Run the .reg replacing the path of lc_manifest.json
  • Put mainfest.json and cs_local_component.js in the same folder
  • Make a Chrome extension out of that folder
  • Configure lc_manifest.json with the right path to the local component
  • Replace %EXTENSION_ID% with the real id of the Chrome extension in lc_manifest.json
@qwe2
qwe2 / ProtectedContent.fsx
Last active August 29, 2015 14:23
Protect Content with WebSharper.Warp
#I "../packages/Owin.1.0/lib/net40"
#I "../packages/Microsoft.Owin.3.0.1/lib/net45"
#I "../packages/Microsoft.Owin.Host.HttpListener.3.0.1/lib/net45"
#I "../packages/Microsoft.Owin.Hosting.3.0.1/lib/net45"
#I "../packages/Microsoft.Owin.FileSystems.3.0.1/lib/net45"
#I "../packages/Microsoft.Owin.StaticFiles.3.0.1/lib/net45"
#I "../packages/WebSharper.3.2.8.170/lib/net40"
#I "../packages/WebSharper.Compiler.3.2.4.170/lib/net40"
#I "../packages/WebSharper.Owin.3.2.6.83/lib/net45"
#load "../packages/WebSharper.Warp.3.2.10.13/tools/reference.fsx"
@qwe2
qwe2 / Client.fs
Last active August 29, 2015 14:25
SimpleTextBox
namespace SimpleTextBox
open WebSharper
open WebSharper.UI.Next
open WebSharper.UI.Next.Html
[<JavaScript>]
module Client =
// Note that Main here is not a function. This is very important as top-level
@qwe2
qwe2 / Lambda.hs
Last active January 13, 2016 14:14
Lambda expr reduction
module Lambda where
import Control.Monad.Trans.Maybe
import Control.Applicative
import Control.Monad.State
import Data.Set (Set)
import qualified Data.Set as Set
import qualified Data.List as List
newtype LambdaVar = LV Char
@qwe2
qwe2 / Main.fs
Created May 2, 2016 09:25
WebSharper simple forms authentication with Sitelet.Protect
namespace SimpleLogin
open WebSharper
open WebSharper.Sitelets
open WebSharper.UI.Next
open WebSharper.UI.Next.Server
type EndPoint =
| [<EndPoint "POST /login">] DoLogin of credentials: Credentials
| [<EndPoint "/login">] Login