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
pre.fssnip | |
{ | |
background:#f0f0f0; | |
font-family:consolas, monaco,'Lucida Console',monospace; | |
font-size:80%; | |
padding:10px; | |
margin:10px 5px 10px 5px; | |
position:relative; | |
} |
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 currentTip = null; | |
var currentTipElement = null; | |
function hideTip(evt, name, unique) | |
{ | |
var el = document.getElementById(name); | |
el.style.display = "none"; | |
currentTip = null; | |
} |
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://stackoverflow.com/questions/4559399/can-parser-combinators-be-made-efficient | |
open System | |
open FParsec.Primitives | |
open FParsec.CharParsers | |
//let inline (<*>) f a = f >>= fun f' -> a >>= fun a' -> preturn (f' a') | |
//let inline lift f a = a |>> f | |
//let inline lift2 f a b = preturn f <*> a <*> b | |
let inline (<%) x y = y >>% x // (lift << (fun a b -> a)) x y | |
let inline ( *>) x y = x >>. y // lift2 (fun _ z -> z) x y |
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 editContact cmgr = | |
getQueryString "id" | |
|> Result.map (Option.bind Int32.tryParse) | |
|> Result.map (Option.bind (fun i -> | |
match Contact.GetById i cmgr with | |
| Tx.Commit c -> c | |
| _ -> None)) | |
|> Result.map (Option.map (fun c -> | |
let editForm = contactFormlet c |> renderToXml | |
let view = contactEditOkView editForm |
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
module ParserHelpers | |
open System | |
open Fissum.Linq.Wiql | |
/// Intercepts parsing error | |
let internal handleParsingError (ctxt: Microsoft.FSharp.Text.Parsing.ParseErrorContext<_>)= | |
failwith ctxt.Message | |
/// Trims the field name from lexer input |
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
pepe.fs: | |
let a = None | |
let b = Some 2 | |
compiles to: | |
[CompilationMapping(SourceConstructFlags.Module)] | |
public static class Pepe | |
{ | |
[CompilationMapping(SourceConstructFlags.Value)] |
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 Fmap = Fmap with | |
static member (?<-) (_, _Functor:Fmap, x:option<_> ) = fun f -> Option.map f x | |
static member (?<-) (_, _Functor:Fmap, g:_->_ ) = (>>) g | |
let inline fmap f x = (() ? (Fmap) <- x) f | |
Then in a separate assembly: | |
type Fmap with | |
static member (?<-) (_, _Functor:Fmap, x:list<_> ) = fun f -> List.map f 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
I'm getting this message when logging in: | |
"Account Blocked! (#MA104) Please contact customer support" | |
I read in a forum that this was due to inactivity. Please consider explaining the reason when logging in instead of a cryptic message with no information. | |
Payoneer should send a message of reliability, but this is the exact opposite message. I'm already looking for alternatives to Payoneer... |
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
namespace Extensions | |
open System.Text.RegularExpressions | |
///Regex extensions | |
module Regex = | |
let replaceWithAcc folder state input (rx: Regex) = | |
let acc = ref state | |
let evaluator (m: Match) = | |
let newState, result = folder !acc m | |
acc := newState |
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
mainrepo="mausch/solrnet" | |
urls=$(curl -s "https://api.github.com/repos/$mainrepo/forks" | grep git_url | sed -re 's/.*: "(.*)",/\1/') | |
for url in $urls; do | |
remote=$(echo $url | cut -d/ -f4) | |
git remote add $remote $url | |
done |