Skip to content

Instantly share code, notes, and snippets.


Brendan Zagaeski brendanzagaeski

  • Boston, MA, United States
View GitHub Profile
brendanzagaeski / AndHUDNullCheck.patch
Created Mar 5, 2014
Patch to prevent NullReferenceException in AndHUD
View AndHUDNullCheck.patch
diff --git a/AndHUD/AndHUD.cs b/AndHUD/AndHUD.cs
index 2022fcb..6d57870 100644
--- a/AndHUD/AndHUD.cs
+++ b/AndHUD/AndHUD.cs
@@ -222,10 +222,12 @@ namespace AndroidHUD
- Application.SynchronizationContext.Post(state => {
- progressWheel.SetProgress (progress);
brendanzagaeski / Socialize.cs
Created Mar 17, 2014
Hand-adjusted binding for `Socialize.SocializeActivityLifecycleListener` property in the Socialize Android SDK. Works around ("Error CS1061: Type ... does not contain a definition for `Handler' and no extension method `Handler'..." and "Error CS1729: The type ... does not contain a constructor t…
View Socialize.cs
using System;
using Android.Runtime;
namespace Com.Socialize
public partial class Socialize
static IntPtr id_getSocializeActivityLifecycleListener;
static IntPtr id_setSocializeActivityLifecycleListener_Lcom_socialize_ui_SocializeActivityLifecycleListener_;
brendanzagaeski / TwitterAuthWebView.cs
Created Mar 18, 2014
Work around for Xamarin.Android binding of methods in the Socialize SDK's `ITwitterAuthWebView` that are inherited as properties from `WebView`
View TwitterAuthWebView.cs
using System;
using Android.Views;
using Android.Webkit;
namespace Com.Socialize.Auth.Twitter
/// <summary>
/// Use "wrapper" methods to work around these two binding errors:
/// Error message: Error CS0535: `Com.Socialize.Auth.Twitter.TwitterAuthWebView' does not implement interface member `Com.Socialize.Auth.Twitter.ITwitterAuthWebView.SetLayoutParams(Android.Views.ViewGroup.LayoutParams)' (CS0535)
/// Error message: Error CS0535: `Com.Socialize.Auth.Twitter.TwitterAuthWebView' does not implement interface member `Com.Socialize.Auth.Twitter.ITwitterAuthWebView.SetVisibility(int)' (CS0535)
brendanzagaeski / gist:9679610
Created Mar 21, 2014
Xamarin.iOS does not support the System.Dynamic namespace
View gist:9679610
# Xamarin.iOS does not support the System.Dynamic namespace [1]
This also means that Xamarin.iOS app projects cannot use PCLs that depend on System.Dynamic.
## Error messages when trying to use a PCL that depends on System.Dynamic
### Visual Studio, without the Xamarin.iOS `System.Dynamic.Runtime` facade assembly (see also [2])
brendanzagaeski / gist:9923465
Created Apr 1, 2014
Xamarin Pixate component, potential bug on Xcode 5.1
View gist:9923465
Under certain circumstances the Pixate library can cause an assertion error:
> *** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /SourceCache/UIKit_Sim/UIKit-2903.23/UITableView.m:6246
> *** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /SourceCache/UIKit/UIKit-2935.137/UITableView.m:6509
Continuing through the assertion produces an unhandled exception, and stack traces. It turns out the most interesting part of the stack traces is the involvement of `[PXUITableView layoutSubviews]`.
brendanzagaeski / AndroidNativeLibrariesMoveApp.txt
Created Apr 11, 2014
Using the app "Move" feature on some Android phones leads to broken permissions on `lib/` directory
View AndroidNativeLibrariesMoveApp.txt
# Using the app "Move" feature on some Android phones leads to broken permissions on `lib/` directory
Starting around Android 15 (Ice Cream Sandwich), or possibly earlier, the "Move to SD" feature on Android underwent some changes. Many modern phones do not support the feature at all. Others support it, but inconsistently (see also [1]).
On an HTC One X running Android 4.1.1, moving an app to USB Storage and then back to internal storage changes the permissions of the app's `/data/data/package_name/lib` directory, breaking the app if it depends on native libraries. This problem affects Xamarin.Android apps and Java NDK apps alike.
brendanzagaeski / prefix.pch
Created Apr 23, 2014
Default prefix.pch file for Mac projects in Xcode
View prefix.pch
// Prefix header
// The contents of this file are implicitly included at the beginning of every source file.
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
brendanzagaeski / DropboxSync.cs
Last active Aug 29, 2015
ObjectiveSharpie 0.4.40 binding output for OS X Dropbox Sync SDK
View DropboxSync.cs
// ObjectiveSharpie 0.4.40 binding output for OS X Dropbox Sync SDK
// IMPORTANT: The Dropbox Sync SDK for OS X is _only_ distributed as a 64-bit
// binary. Xamarin.Mac is currently 32-bit only, so it _cannot_ consume the
// Dropbox library. Xamarin.Mac 64-bit support is in progress [1], so this
// limitation will be solved in the not-to-distant future. But for now, the
// Dropbox Sync SDK is not compatible with Xamarin.Mac.
// [1]
brendanzagaeski / AviarySDKApiDefinition.cs
Created May 15, 2014
Objective Sharpie output for iOS Aviary SDK version 4.0.1
View AviarySDKApiDefinition.cs
using System.Drawing;
using System;
using MonoTouch.Foundation;
namespace AviarySDK {
public enum AFPhotoEditorPremiumAddOn : [unmapped: unexposed: Elaborated] {
None = 0,
HiRes = 1 << 0,
brendanzagaeski /
Last active Aug 29, 2015
Install path fixups for GTK# with Xamarin.Mac mmp
cp /Library/Frameworks/Mono.framework/Versions/Current/lib/libgdk_pixbuf-2.0.0.dylib "$1/Contents/MonoBundle/"
cp /Library/Frameworks/Mono.framework/Versions/Current/lib/libgio-2.0.0.dylib "$1/Contents/MonoBundle/"
cp /Library/Frameworks/Mono.framework/Versions/Current/lib/libgmodule-2.0.0.dylib "$1/Contents/MonoBundle/"
cp /Library/Frameworks/Mono.framework/Versions/Current/lib/libffi.6.dylib "$1/Contents/MonoBundle/"
cp /Library/Frameworks/Mono.framework/Versions/Current/lib/libxml2.2.dylib "$1/Contents/MonoBundle/"
find $1 -name "*.config" | while read FILE; do
sed -i "" 's:/Library/Frameworks/Mono.framework/Versions/3.12.1/lib/:@executable_path/../MonoBundle/:' "$FILE";
You can’t perform that action at this time.