Skip to content

Instantly share code, notes, and snippets.

View rasmuschristensen's full-sized avatar
💭
Working remotely

Rasmus Tolstrup Christensen rasmuschristensen

💭
Working remotely
View GitHub Profile
@rasmuschristensen
rasmuschristensen / WrapPanelUsage
Created May 4, 2017 14:16
How to use WrapPanel
<ScrollView>
<appControls:WrapLayout
Margin="2"
VerticalOptions="FillAndExpand"
Spacing="6"
RowSpacing="10"
MaxColumns="3"
ItemsSource="{Binding Ads}"
x:Name="thelist">
<appControls:WrapLayout.ItemTemplate>
@rasmuschristensen
rasmuschristensen / appcenter-pre-build.sh
Created December 13, 2017 21:44
prebuild Appcenter script
#!/usr/bin/env bash
if [ "$APPCENTER_BRANCH" != "master" ];
then
echo "NOT Master"
else
echo "Is Master"
fi
@rasmuschristensen
rasmuschristensen / ExistsAsync
Created August 18, 2019 13:53
CosmosDb Async Exists support
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;
<?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>
@rasmuschristensen
rasmuschristensen / main.dart
Created April 14, 2020 18:50
Tristate button animation
// 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