Skip to content

Instantly share code, notes, and snippets.

View Redth's full-sized avatar
🏠
Working from home

Jonathan Dick Redth

🏠
Working from home
View GitHub Profile
@Redth
Redth / CrisisCheckin-WebAPI.md
Last active August 29, 2015 14:04
Draft of what the Crisis Checkin Web API for mobile apps might be

Here is a proposal for a web api for the Crisis Checkin app which the mobile apps will call.

General Notes about the API

The API should send and receive JSON data.

The Base Url should be /api/

All responses should include one of the following http response status codes:

  • 200 - OK
  • 403 - Authentication Failed (Auth Token bad)
version: 19.0.0.2
name: Google Play Services
id: googleplayservices
publisher: Xamarin Inc.
no_build: true
publisher-url: http://xamarin.com
summary: Give your apps more features to attract users on a wider range of devices.
libraries:
android:
- source/binding/GooglePlayServicesLib/GooglePlayServicesLib.dll
@Redth
Redth / tasks.cs
Last active August 29, 2015 14:07
var toSend = from n in Broker.TakeMany ()
select Connection.Send (n);
await Task.WhenAll (toSend).ConfigureAwait (false);
foreach (var t in toSend) {
await t; //Probably a no-op, should return immediately in any case
if (t.Exception != null)
Broker.RaiseNotificationSucceeded (null); // Need to pass back 'n' here
using System;
using Android.Support.Wearable.Watchface;
using Android.App;
using Android.Runtime;
namespace WatchFace
{
public class MyWatchFaceService : CanvasWatchFaceService
{
public override CanvasWatchFaceService.Engine OnCreateEngine ()
version: 1.0.1.0
name: Example Component
id: example-component
publisher: Xamarin
publisher-url: "http://xamarin.com"
summary: An example after moving to NuGet dependencies
libraries:
android:
- ../build/android/Example.dll
ios:
@Redth
Redth / Client.cs
Created February 9, 2015 17:42
ThisLife C# API Client
using System;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Net.Http;
using System.Net.Http.Headers;
namespace ThisLife
{
public class ThisLifeClient
@Redth
Redth / c#.cs
Last active August 29, 2015 14:21
Covariant Types: C# vs Java
public abstract class Animal
{
public abstract string Name { get; }
}
public abstract class AnimalFactory
{
public abstract Animal Create ();
public abstract void Process (Animal animal);
}
diff --git a/src/Cake.Core/Utilities/Tool.cs b/src/Cake.Core/Utilities/Tool.cs
index 432bcbe..af98470 100644
--- a/src/Cake.Core/Utilities/Tool.cs
+++ b/src/Cake.Core/Utilities/Tool.cs
@@ -1,5 +1,7 @@
using System;
+using System.Collections.Generic;
using System.Globalization;
+using System.Linq;
using Cake.Core.IO;
@Redth
Redth / cake.rb
Last active August 29, 2015 14:26
class Cake < Formula
depends_on "mono" => :optional
version "0.5.1"
sha256 "e3620f9bb1466d47502aeb934868284e241877ad5f43531f898443d846bd7c0b"
desc "Cake (C# Make) is a build automation system with a C# DSL to do things like compiling code, copy files/folders, running unit tests, compress files and build NuGet packages."
homepage "http://cakebuild.net/"
url "https://www.nuget.org/api/v2/package/Cake/#{version}"
def install
Cleaning: Microsoft.Intune.Android (Debug)
Build started 2015-11-09 9:12:21 AM.
__________________________________________________
Project "/Users/redth/xamarin/MicrosoftInTune/source/bindings/Android/Microsoft.Intune.Android.csproj" (Clean target(s)):
Initial Properties:
__CF_USER_TEXT_ENCODING = 0x1F5:0x0:0x0
AndroidLinkMode = None