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 / Xamarin.Flurry.cs
Created May 9, 2013 19:04
Flurry analytics for Xamarin.iOS, Xamarin.Android, Windows Phone
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#if MONODROID
using Android.Telephony;
#endif
#if MONOTOUCH
using MonoTouch.Foundation;
/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
// This file is automatically generated and not supposed to be modified.
using System;
using Boolean = System.Boolean;
using String = System.String;
using List = Android.Runtime.JavaList;
using Map = Android.Runtime.JavaDictionary;
using Android.OS;
namespace Com.Android.Vending.Billing
{
@Redth
Redth / LogCollector.cs
Created June 25, 2013 20:35
Collect Android Logs and Version info in Xamarin.Android
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Android.Hardware;
namespace HeyKarlWakeUp
public void SetProgress(int i)
{
isSpinning = false;
var newProgress = (int)((float)i / (float)100 * (float)360);
if (version >= Android.OS.BuildVersionCodes.Honeycomb)
{
Android.Animation.ValueAnimator va =
(Android.Animation.ValueAnimator)Android.Animation.ValueAnimator.OfInt (progress, newProgress).SetDuration (250);
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
namespace EggsTest
{
@Redth
Redth / IUILayoutSupportExtensions.cs
Created September 26, 2013 15:37
The Length property is currently missing from the Xamarin.iOS API for IUILayoutSupport (TopLayoutGuide, BottomLayoutGuide). Here's a quick hack to fix it temporarily...
using MonoTouch.UIKit;
using MonoTouch.ObjCRuntime;
namespace Shield
{
public static class TopLayoutGuideExtensions
{
public static float Length(this IUILayoutSupport layoutSupport)
{
float length = 0f;// = 0;
@Redth
Redth / gist:8649907
Created January 27, 2014 14:56
NSData Selectors
@implementation NSData (AirfoilIntegrationSampleAdditions)
+ (id)scriptingAirfoilImageWithDescriptor:(NSAppleEventDescriptor *)descriptor
{
if ( [descriptor descriptorType] == typeType && [descriptor typeCodeValue] == cMissingValue )
{
return nil;
}
if ( [descriptor descriptorType] != typeTIFF )
{
on remote_stop()
end remote_stop
on remote_play()
tell application id "com.altusapps.gtunesapp"
playpause
end tell
end remote_play
on remote_previous_item()