Skip to content

Instantly share code, notes, and snippets.

@Krumelur
Krumelur / PickerTunerEffect.Droid.cs
Last active September 21, 2017 08:37
Customise "Done" button in Forms picker with an Effect
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using System.Reflection;
using Android.Views;
using Android.App;
using static Android.Views.View;
using Android.Content;
using PickerTest.Droid;
using System.Threading.Tasks;
using System.Web.Http;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Connector;
using System.Linq;
namespace XamUBot
{
/// <summary>
/// This controller handles all incoming messages the bot can process.
using System;
using System.Runtime.CompilerServices;
namespace LeakTest
{
public class MemoryLeakCheck<T> where T : class
{
string filename;
int lineNumber;
WeakReference<T> reference;
using System;
using System.Runtime.CompilerServices;
namespace LeakTest
{
public class MemoryLeakCheck<T> where T : class
{
string filename;
int lineNumber;
WeakReference<T> reference;
@Krumelur
Krumelur / demo.xaml
Created June 28, 2017 08:36
Style setters
<Style x:Key="infoLabelStyle" TargetType="Label">
<Setter Property="TextColor" Value="Green" />
</Style>
<Style x:Key="testStyle" TargetType="Label">
<Setter Property="TextColor" Value="Red" />
</Style>
<Label x:Name="totalOutput" Text="0.00" Style="{StaticResource infoLabelStyle}" Grid.Row="2" Grid.Column="1">
<Label.Triggers>
public override View GetView (int position, View convertView, ViewGroup parent)
{
var inflater = LayoutInflater.From (parent.Context);
var view = convertView;
if(view == null)
{
view = inflater.Inflate (Resource.Layout.InstructorRow, parent, false);
}
namespace System.Threading.Tasks.Schedulers
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
class Program
{
using Foundation;
using UIKit;
using System;
namespace NotifyMe
{
public static class NotificationHelper
{
public static void CreateDailyNotification (string title, string message, DateTime shownFirst)
{
using System;
using UIKit;
using QuickLook;
using Foundation;
namespace Preview
{
class PreviewDataSource : QLPreviewControllerDataSource
{
@Krumelur
Krumelur / XTC201 life-savers.txt
Created January 15, 2016 22:29
Various thing about Calabash I wish I had known earlier...
• Sandbox download: https://github.com/calabash/install
• Directly install Sandbox from Terminal: curl -sSL https://raw.githubusercontent.com/calabash/install/master/install-osx.sh | bash
• List of Calabash environment variables can be found at: http://calabashapi.xamarin.com/ios/file.ENVIRONMENT_VARIABLES.html
• List all iOS devices in Terminal to get "DEVICE_TARGET": instruments -s devices
• Set Simulator ID in one go when running a test: APP_BUNDLE_PATH=TaskyiOS.app DEVICE_TARGET="iPhone 6s (9.2)" cucumber
• Show Calabash iOS version: calabash-ios version
• Update to latest Calabash (run in Calabash Sandbox): gem install calabash-cucumber
• Get Sandbox Version: calabash-sandbox version
• Check what is using the Calabash Server's port: lsof -wni tcp:37265
○ If something uses the port You can grab the `pid` and `kill -9` it