Skip to content

Instantly share code, notes, and snippets.

View andreas-nesheim's full-sized avatar

Andreas Nesheim andreas-nesheim

View GitHub Profile
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using Millheat.Api;
using System.Threading.Tasks;
namespace Millheat.Functions
{
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>ListView Template</Title>
<Author>Andreas Nesheim</Author>
<Description>Snippet for creating a simple ListView with a bindable ItemsSource</Description>
<Shortcut>lv</Shortcut>
</Header>
<Snippet>
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>CollectionView Template</Title>
<Author>Andreas Nesheim</Author>
<Description>Snippet for creating a simple CollectionView with a bindable ItemsSource</Description>
<Shortcut>cv</Shortcut>
</Header>
<Snippet>
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Formatted String</Title>
<Author>Andreas Nesheim</Author>
<Description>Snippet for a FormattedString Label</Description>
<Shortcut>stringf</Shortcut>
</Header>
<Snippet>
@andreas-nesheim
andreas-nesheim / CollectionView.snippet
Last active June 9, 2020 12:18
XAML code snippets
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>CollectionView Template</Title>
<Author>Andreas Nesheim</Author>
<Description>Snippet for creating a simple CollectionView with a bindable ItemsSource</Description>
<Shortcut>cv</Shortcut>
</Header>
<Snippet>
var loginResult = await "https://url.for.parking/registration/site/login"
.WithCookies(out var cookies)
.PostJsonAsync(new { UserName = "xxxx", Password = "xxxx" });
var vehichleDataResult = await "https://url.for.parking/registration/site/vehicle"
.WithCookies(cookies)
.PostJsonAsync(new { LicensePlate = licensePlate })
.ReceiveJson();
var bookParkingResult = await "https://url.for.parking/registration/site/checkin"
.WithCookies(cookies)
.PostJsonAsync(new
{
cmnt = "",
days = "2",
extnidfc = "",
gustname = guestName,
hours = "0",
nmbrplte = licensePlate,
private async void BookButtonGolf_Clicked(object sender, EventArgs e)
{
var result = await runeParkClient.BookParkingAsync("Andreas Nesheim", "XX00000");
await DisplayAlert("Status", result ? "Parking was successful!" : "Parking failed or already registered", "OK");
}
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>prismPropEBM</Title>
<Shortcut>prismpropebm</Shortcut>
<Description>Code snippet for property and backing field using Prism with expression bodied members</Description>
<Author>Andreas Nesheim</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>