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
#if INTERACTIVE | |
#r "System.Net.Http" | |
#endif | |
module MimeTip | |
open System.IO | |
open System.Net.Http | |
open System.Runtime.InteropServices |
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 "System.ComponentModel.Composition" | |
#if INTERACTIVE | |
#r "../Pretzel.exe" | |
#r "LibSass.x86.dll" | |
#r "libsassnet.dll" | |
#endif | |
open System.ComponentModel.Composition | |
open Pretzel.Logic.Extensibility | |
open Pretzel.Logic.Templating.Context |
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 @"C:\Users\TBurger\Downloads\UnityEngine.dll" | |
open UnityEngine | |
module Unity = | |
[<AutoOpen>] | |
module Log = | |
let inline uprintfn fmt = | |
Printf.kprintf Debug.Log fmt |
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
param ([string[]]$Computer = ".") | |
@($Computer) | % { | |
$c = $_ | |
if ($c -eq '.') { $c = $env:COMPUTERNAME } | |
$os = get-wmiobject Win32_OperatingSystem -Computer $_ | |
$physical = Get-WmiObject CIM_PhysicalMemory -Computer $_ | |
$free = $os.FreePhysicalMemory |
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 "System.Speech" | |
open System.Speech.Synthesis | |
let synt = new SpeechSynthesizer() | |
// synt.Rate <- 5 // schneller mochn! | |
let say s = synt.Speak(s: string) | |
[1 .. 100] | |
|> List.map (fun n -> | |
match n%3, n%5 with |
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 Reflection = | |
open Microsoft.FSharp.Quotations | |
open Microsoft.FSharp.Quotations.Patterns | |
open System.Reflection | |
let private (|Name|) (info: MemberInfo) = info.Name | |
let private (|PropertyName|_|) = function | |
| PropertyGet (_, Name name, _) -> Some name | |
| _ -> None |
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
<?php | |
function diff($array1, $array2, $compare_func) { | |
return array_diff_ukey($array1, $array2, function($key1, $key2) use ($array1, $array2, $compare_func) { | |
if (!isset($array1[$key1])) return 1; | |
if (!isset($array2[$key2])) return -1; | |
return $compare_func($array1[$key1], $array2[$key2]); | |
}); | |
} |
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
function maybe(value) { | |
const isEmpty = () => value === undefined || value === null; | |
const nonEmpty = () => !isEmpty(); | |
return { | |
map(f) { return isEmpty() ? this : maybe(f(value)) }, | |
getOrElse(n) { return isEmpty() ? n : value }, | |
isEmpty: isEmpty, | |
nonEmpty: nonEmpty | |
} | |
} |
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
(* | |
JsonParser.fsx | |
A JSON parser built from scratch using a combinator library. | |
Related blog post: http://fsharpforfunandprofit.com/posts/understanding-parser-combinators-4/ | |
*) | |
module JsonParser |
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
(* | |
ParserLibrary.fsx | |
Final version of a parser library. | |
Related blog post: http://fsharpforfunandprofit.com/posts/understanding-parser-combinators-3/ | |
*) | |
module ParserLibrary |