Skip to content

Instantly share code, notes, and snippets.

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

Matthew Leibowitz mattleibow

🏠
Working from home
View GitHub Profile
@mattleibow
mattleibow / gist:0bf9fe8bcb6321f91314
Created February 13, 2015 20:38
OxyPlot component.yaml
%YAML 1.2
---
id: oxyplot
name: OxyPlot
version: COMPONENT_VERSION
summary: A cross-platform plotting library for .NET
publisher: OxyPlot.org
publisher-url: http://oxyplot.org
@mattleibow
mattleibow / gist:32e0a9fcc4a59893c25b
Created February 26, 2015 13:25
Disposing Dialogs
// in normal code flow:
[Activity(Label = "App1", MainLauncher = true, Icon = "@drawable/icon")]
public class MainActivity : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);

Introducing the Microsoft Band SDK Preview for Xamarin.Android

Microsoft finally released an SDK for the Microsoft Band! The Band is very much designed for health and fitness uses with many sensors. But, it is certainly not limited to health uses. Because we have access to the sensors and can interact with the device, we can use the Band to enhance and extend your app. Working with Band essentially means communicating with the Band from the app installed on the device.

There are 4 main areas that we can interact with the Band:

  1. Reading information from the Sensors
  2. Creating themed app Tiles
  3. Sending Messages to the Band
  4. Theming and Personalizing the Band
@mattleibow
mattleibow / gist:2cef8c6c4d62bad26275
Last active August 29, 2015 14:19
Microsoft Band SDK - Navigation Issues
// The code that shows the confirmation popup/page
public async Task<Boolean> GetAddTileConsentAsync(BandTile tile, CancellationToken token)
{
Boolean flag;
CoreApplicationView mainView = CoreApplication.MainView;
if (mainView != null)
{
CoreWindow coreWindow = mainView.CoreWindow;
if (coreWindow != null)
@mattleibow
mattleibow / gist:2fafa506fe634f8c19e9
Created May 1, 2015 14:48
Portable Band Tile Page Syntax
new PageLayout {
Root = new ScrollFlowPanel {
Rectangle = new Rectangle(15, 0, 245, 105),
Orientation = Orientation.Vertical,
Elements = {
new FlowPanel {
Rectangle = new Rectangle(0, 0, 245, 70),
Orientation = Orientation.Horizontal,
Elements = {
new Image {
=== Xamarin Studio ===
Version 5.9 (build 431)
Installation UUID: c9e4f285-0f71-4adb-9e10-6c574b1905a5
Runtime:
Mono 4.0.0 ((detached/d136b79)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400000143
// @interface ORKOrderedTask : NSObject <ORKTask, NSSecureCoding, NSCopying>
[BaseType (typeof(NSObject))]
interface ORKOrderedTask : ORKTask, INSSecureCoding, INSCopying
{
// -(instancetype)initWithIdentifier:(NSString *)identifier steps:(NSArray *)steps __attribute__((objc_designated_initializer));
[Export ("initWithIdentifier:steps:")]
IntPtr Constructor (string identifier, [NullAllowed] ORKStep[] steps);
// // -(instancetype)initWithCoder:(NSCoder *)aDecoder __attribute__((objc_designated_initializer));
[Export ("twoFingerTappingIntervalTaskWithIdentifier:intendedUseDescription:duration:options:")]
[CompilerGenerated]
public static ORKOrderedTask CreateTwoFingerTappingIntervalTask (string identifier, string intendedUseDescription, global::System.Double duration, ORKPredefinedTaskOption options)
{
if (identifier == null)
throw new ArgumentNullException ("identifier");
var nsidentifier = NSString.CreateNative (identifier);
var nsintendedUseDescription = NSString.CreateNative (intendedUseDescription);
ORKOrderedTask ret;
@mattleibow
mattleibow / gist:a702e23de15e4e073a43
Last active August 29, 2015 14:24
Building CppSharp and dependencies
#!/bin/bash
# download CppSharp
if [ ! -s CppSharp/.git ]; then
git clone -b master --single-branch https://github.com/mono/CppSharp.git CppSharp
fi
# download LLVM
if [ ! -s CppSharp/deps/llvm/.git ]; then
git clone http://llvm.org/git/llvm.git CppSharp/deps/llvm
(cd CppSharp/deps/llvm && git checkout 0e8abfa6ed986c892ec723236e32e78fd9c47b88)
@mattleibow
mattleibow / gist:42c32110f161bfee0312
Created July 16, 2015 16:19
Mac NuGets in VS2015
Error occured:\nSystem.Xml.XmlException: 'Default' tag requires a nonempty 'Extension' attribute. Line 1, position 318.
at System.IO.Packaging.ZipPackage.ContentTypeHelper.ValidateXmlAttribute(String attributeName, String attributeValue, String tagName, XmlTextReader reader)
at System.IO.Packaging.ZipPackage.ContentTypeHelper.ProcessDefaultTagAttributes(XmlTextReader reader)
at System.IO.Packaging.ZipPackage.ContentTypeHelper.ParseContentTypesFile(ZipFileInfoCollection zipFiles)
at System.IO.Packaging.ZipPackage.ContentTypeHelper..ctor(ZipArchive zipArchive, IgnoredItemHelper ignoredItemHelper)
at System.IO.Packaging.ZipPackage..ctor(Stream s, FileMode mode, FileAccess access, Boolean streaming)
at System.IO.Packaging.Package.Open(Stream stream, FileMode packageMode, FileAccess packageAccess, Boolean streaming)
at System.IO.Packaging.Package.Open(Stream stream)
at NuGet.OptimizedZipPackage.EnsureManifest()
at NuGet.OptimizedZipPackage..ctor(IFileSystem fileSystem, String packagePath