Skip to content

Instantly share code, notes, and snippets.

Michael Ridland rid00z

Block or report user

Report or block rid00z

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ViewController.cs
using System;
using System.Collections.Generic;
using System.Linq;
using ARKit;
using ARKitExample.Nodes;
using Foundation;
using SceneKit;
using UIKit;
namespace ARKitExample
View WeatherResult
public class Coord
{
public double lon { get; set; }
public double lat { get; set; }
}
public class Weather
{
public int id { get; set; }
public string main { get; set; }
@rid00z
rid00z / AndroidResourcesPolyFill.cs
Created May 16, 2016
This is a Android Resources Polyfill for Xamarin.Forms 2.2 when 3rd party libraries have not' updated.
View AndroidResourcesPolyFill.cs
using System;
namespace Yournamespace
{
public partial class Resource
{
public partial class Attribute
{
// public const int mediaRoutePlayDrawable = -1;
public const int mediaRouteSettingsDrawable = -2;
@rid00z
rid00z / TextBlobOperations.cs
Created Mar 22, 2016
Text Blob Operation and Attribute
View TextBlobOperations.cs
public static class TextBlobOperations
{
public static void GetTextBlobs(object element)
{
if (element == null)
return;
var type = element.GetType();
foreach (var relationshipProperty in type.GetTextBlobProperties())
{
@rid00z
rid00z / AsyncHelper.cs
Created Sep 19, 2015
This code can be used to task a async task and run it without the async part.
View AsyncHelper.cs
public static class AsyncHelper
{
private static readonly TaskFactory _myTaskFactory = new
TaskFactory(CancellationToken.None,
TaskCreationOptions.None,
TaskContinuationOptions.None,
TaskScheduler.Default);
public static TResult RunSync<TResult>(Func<Task<TResult>> func)
{
@rid00z
rid00z / BindablePropertyTemplate.cs
Created Sep 19, 2015
Visual/Xamarin Studio - Bindable Property Template for Xamarin.Forms
View BindablePropertyTemplate.cs
public static readonly BindableProperty $Name$Property =
BindableProperty.Create<$owner$, $type$>(
p => p.$Name$, default($type$));
public $type$ $Name$ {
get { return ($type$)GetValue($Name$Property); }
set { SetValue($Name$Property, value); }
}
@rid00z
rid00z / Extensions.cs
Created Jul 15, 2015
Bluetooth APIs with TaskCompletionSource
View Extensions.cs
using System;
using System.Threading.Tasks;
using System.Linq;
using System.Diagnostics;
namespace Robotics.Mobile.Core.Bluetooth.LE
{
public static class Extensions
{
/// <summary>
@rid00z
rid00z / RemoteDataSource.cs
Last active Aug 29, 2015
Remote Data Source
View RemoteDataSource.cs
/*
* Note* this is for demo purposes only and is not a example of good network code,
* http://www.michaelridland.com/mobile/asp-net-mvc-xamarin-mashups/
*/
public class RemoteDataSource : IDataSource
{
static string HostBase = "http://192.168.56.101:49203";
public RemoteDataSource ()
{
}
View LocalDataSource.cs
public class LocalDataSource : IDataSource
{
SQLiteConnection _sqliteConnection;
public LocalDataSource ()
{
_sqliteConnection = Xamarin.Forms.DependencyService.Get<ISQLiteFactory> ().GetConnection("app.db");
CreateTable ();
}
@rid00z
rid00z / JellyBeanGraphCalculator.cs
Last active Aug 29, 2015
JellyBeanGraphCalculator
View JellyBeanGraphCalculator.cs
public class JellyBeanGraphCalculator
{
IDataSource _datasource;
public JellyBeanGraphCalculator (IDataSource datasource)
{
_datasource = datasource;
}
public IEnumerable<JellyBeanGraphData> GetGraphData()
{
You can’t perform that action at this time.