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 "nuget: FSharp.Json" | |
open FSharp.Json | |
[<JsonUnion(Mode = UnionMode.CaseKeyDiscriminatorField, CaseKeyField="version")>] | |
type VersionedDto = | |
| V0 of DtoV0 | |
| V1 of DtoV1 | |
and DtoV0 = { | |
Prop1: string |
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
:: Get admin permission | |
:------------------------------------- | |
REM --> Check for permissions | |
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" | |
REM --> If error flag set, we do not have admin. | |
if '%errorlevel%' NEQ '0' ( | |
echo Requesting administrative privileges... | |
goto UACPrompt | |
) else ( goto gotAdmin ) |
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
{ | |
"context": { | |
"portalLink": "http://www.freerangeeggs.net/" | |
} | |
} |
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 request = require('request'); | |
if(data) { | |
var slackUrl = "<YOUR SLACK URL>"; | |
var text = { | |
"text": "Something happened!!\n<" + data.context.portalLink + "|Check it out>" | |
}; | |
var requestData = { | |
url: slackUrl, | |
method: "POST", |
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('first' in data && 'last' in data) { | |
context.res = { | |
body: { greeting: 'Hello ' + data.first + ' ' + data.last + '!'} | |
}; | |
} |