Skip to content

Instantly share code, notes, and snippets.

Avatar

Andreas Nesheim andreas-nesheim

View GitHub Profile
View RunePark-4.cs
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");
}
View RunePark-3.cs
var bookParkingResult = await "https://url.for.parking/registration/site/checkin"
.WithCookies(cookies)
.PostJsonAsync(new
{
cmnt = "",
days = "2",
extnidfc = "",
gustname = guestName,
hours = "0",
nmbrplte = licensePlate,
View RunePark-2.cs
var vehichleDataResult = await "https://url.for.parking/registration/site/vehicle"
.WithCookies(cookies)
.PostJsonAsync(new { LicensePlate = licensePlate })
.ReceiveJson();
View RunePark-1.cs
var loginResult = await "https://url.for.parking/registration/site/login"
.WithCookies(out var cookies)
.PostJsonAsync(new { UserName = "xxxx", Password = "xxxx" });
View CollectionView.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>
View FormattedString.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>
View CollectionView.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>
View ListView.snippet
<?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>
View millheat-azfunctions.cs
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
{
View millheatclient-7.cs
public async Task SetDevice(Device device, int temperature, int operation, int status)
{
var requestUrl = $"uds/deviceControlForOpenApi?deviceId={device.deviceId}&holdTemp={temperature}&operation={operation}&status={status}";
var response = await httpClient.PostAsync(requestUrl, stringData);
var result = await response.Content.ReadAsStringAsync();
}