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
// MIT License | |
// | |
// Copyright (c) 2020 Rasmus Christensen | |
// | |
// Thanks to Simon Simon Lightfoot for inspiration. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> | |
<Title>NUnit Test Method</Title> | |
<Author>Rasmus Tolstrup Christensen</Author> | |
<Description>Code snippet for a test method</Description> |
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
public static class ContainerExtensions | |
{ | |
public static async Task<bool> ExistsAsync<T>(this Container container, Expression<Func<T,bool>> predicate) | |
{ | |
var qdef = container.GetItemLinqQueryable<T>().Where(predicate).ToQueryDefinition(); | |
var iterator = container.GetItemQueryIterator<T>(qdef.QueryText, null, new QueryRequestOptions { MaxItemCount = 1 }); | |
if (!iterator.HasMoreResults) return false; |
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
#!/usr/bin/env bash | |
if [ "$APPCENTER_BRANCH" != "master" ]; | |
then | |
echo "NOT Master" | |
else | |
echo "Is Master" | |
fi |
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
<ScrollView> | |
<appControls:WrapLayout | |
Margin="2" | |
VerticalOptions="FillAndExpand" | |
Spacing="6" | |
RowSpacing="10" | |
MaxColumns="3" | |
ItemsSource="{Binding Ads}" | |
x:Name="thelist"> | |
<appControls:WrapLayout.ItemTemplate> |
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
$swaggerEndpoint = "http://localhost:9000/swagger/docs/v1" | |
$outputDirectory = "targetfolder" | |
$autoRestRelativePath = "..\..\packages\autorest.0.17.3\tools\AutoRest.exe" | |
& $autoRestRelativePath -Input $swaggerEndpoint -Namespace "com.myproject.Client.Proxies.targetfolder" -OutputDirectory $outputDirectory -CodeGenerator CSharp |
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
private $TYPE$ _$name$; | |
public $TYPE$ $NAME$ | |
{ | |
get { return _$name$; } | |
set { SetProperty(ref _$name$, value); } | |
} |
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Collections.Specialized; | |
using Xamarin.Forms; | |
namespace Controls.Bypassion.dk | |
{ | |
public class WrapLayout : Layout<View> | |
{ |
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
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations(UIApplication application, UIWindow forWindow) | |
{ | |
if (Xamarin.Forms.Application.Current == null || Xamarin.Forms.Application.Current.MainPage == null) | |
{ | |
return UIInterfaceOrientationMask.Portrait; | |
} | |
var navigationPage = Xamarin.Forms.Application.Current.MainPage as NavigationPage; | |
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
public byte[] MakeGrayScale(byte[] imageAsBytes) | |
{ | |
UIImage image = ImageFromByteArray(imageAsBytes); | |
var height = image.Size.Height; | |
var width = image.Size.Width; | |
var imageRect = new CGRect(0, 0, width, height); | |
using (CGBitmapContext context = new CGBitmapContext(IntPtr.Zero, | |
(int)width, (int)height, 8, |
NewerOlder