Skip to content

Instantly share code, notes, and snippets.

@jongeorge1
jongeorge1 / drawarcs.js
Created August 16, 2019 12:35
Arc drawing transition
arcs.transition()
.duration(durations.entryAnimation)
.attrTween("d", d => {
let originalEnd = d.endAngle;
return t => {
let currentAngle = angleInterpolation(t);
if (currentAngle < d.startAngle) {
return "";
}
let generator = d3.pie()
.sort(null);
let chart = generator(data);
let arcs = d3.select("#chart")
.append("g")
.attr("transform", "translate(100, 100)")
.selectAll(".arc")
.data(chart)
d3.select("#chart")
.transition()
.duration(durations.entryAnimation)
.tween("arcRadii", () => {
return t => arc
.innerRadius(innerRadiusInterpolation(t))
.outerRadius(outerRadiusInterpolation(t));
});
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS installer-env
COPY . /src/dotnet-function-app
RUN cd /src/dotnet-function-app && \
mkdir -p /home/site/wwwroot && \
dotnet publish *.csproj --output /home/site/wwwroot
FROM mcr.microsoft.com/azure-functions/dotnet:2.0-arm32v7
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
@jongeorge1
jongeorge1 / Connect.cs
Created September 17, 2019 11:00
Create blob storage connection
var account = CloudStorageAccount.Parse("DefaultEndpointsProtocol=http;BlobEndpoint=http://127.0.0.1:11002/blobs;AccountName=blobs;AccountKey=mm9NYwdA42vTEF9Q6/4A4slU+8pd/VFpBnL5jWvZZkR7W7Bcn3qHsn/mAA3t/ZGZn/U3+Z1gJEWzPgjNMTF8/Q==;");
var client = account.CreateCloudBlobClient();
@jongeorge1
jongeorge1 / Demonstration.feature
Created February 28, 2020 14:26
Demonstration of SpecFlow scenario using child objects
@useChildObjects
Scenario: Demonstrating how this approach looks
Given I have a User called 'Jon'
And I have a User called 'Matthew'
And I have the following expense claims
| Date | Amount | User | Description |
| 26/02/2020 | £25 | {Jon} | Travel to Endjin team away day |
| 26/02/2020 | £40 | {Matthew} | Travel to Endjin team away day |
[BeforeScenario("@useChildObjects", Order = 100)]
public static void SetupValueRetrievers(ScenarioContext scenarioContext)
{
var instance = new ChildObjectValueRetriever(scenarioContext);
scenarioContext.Set(instance, ChildObjectValueRetrieverKey);
Service.Instance.ValueRetrievers.Register(instance);
}
[AfterScenario("@useChildObjects", Order = 100)]
public static void TearDownValueRetrievers(ScenarioContext scenarioContext)
@jongeorge1
jongeorge1 / specflow.config.xml
Created February 28, 2020 14:51
Corvus.SpecFlow.Extensions reference in XML config
<specFlow>
<stepAssemblies>
<stepAssembly assembly="Corvus" />
</stepAssemblies>
</specFlow>
@jongeorge1
jongeorge1 / specflow.json
Created February 28, 2020 14:52
Corvus.SpecFlow.Extensions reference in JSON config
{
"stepAssemblies": [
{ "assembly": "Corvus.SpecFlow.Extensions" }
]
}
Scenario: A Get request including a name in the querystring is successful
Given I start a functions instance for the local project 'DemoFunction' on port 7075 with runtime 'netcoreapp3.0'
When I send a GET request to 'http://localhost:7075/?name=Jon'
Then I receive a 200 response code
And the response body contains the text 'Hello, Jon'