Skip to content

Instantly share code, notes, and snippets.

View brendanzagaeski's full-sized avatar

Brendan Zagaeski brendanzagaeski

  • Microsoft
  • Boston, MA, United States
View GitHub Profile
@brendanzagaeski
brendanzagaeski / bundle-gtk-printing.sh
Created March 30, 2015 07:44
Bundle and modify all the necessary files to allow printing via Gtk.PrintOperation in Xamarin.Mac
echo 'etc/fonts/fonts.conf etc/pango/pango.modules lib/gtk-2.0/2.10.0/engines/libclearlooks.so lib/gtk-2.0/2.10.0/engines/libmurrine.so lib/gtk-2.0/2.10.0/engines/libquartz.so lib/gtk-2.0/2.10.0/engines/libsvg.so lib/gtk-2.0/2.10.0/engines/libxamarin.so lib/gtk-2.0/2.10.0/printbackends/libprintbackend-cups.so lib/gtk-2.0/2.10.0/printbackends/libprintbackend-file.so lib/gtk-2.0/2.10.0/printbackends/libprintbackend-lpr.so lib/gtk-2.0/modules/libferret.so lib/gtk-2.0/modules/libgail.so lib/pango/1.8.0/modules/pango-arabic-lang.so lib/pango/1.8.0/modules/pango-arabic-lang.so.dSYM/Contents/Info.plist lib/pango/1.8.0/modules/pango-arabic-lang.so.dSYM/Contents/Resources/DWARF/pango-arabic-lang.so lib/pango/1.8.0/modules/pango-basic-coretext.so lib/pango/1.8.0/modules/pango-basic-coretext.so.dSYM/Contents/Info.plist lib/pango/1.8.0/modules/pango-basic-coretext.so.dSYM/Contents/Resources/DWARF/pango-basic-coretext.so lib/pango/1.8.0/modules/pango-indic-lang.so lib/pango/1.8.0/modules/pango-indic-lang.so.dSYM/Contents/

The following steps are commands to run in a Terminal.app command prompt. The first step assumes that you have already changed directory with the cd command into the directory that contains the .ipa file (UnifiedSingleViewIphone1.ipa in this example.)

  1. Expand the .ipa archive:

    ditto -xk UnifiedSingleViewIphone1.ipa ./original

  2. Add back the symbolic link, overwriting the incorrect non-linked version of the file:

    ln -fs ../.monotouch-64/UnifiedSingleViewIphone1.exe original/Payload/UnifiedSingleViewIphone1.app/.monotouch-32/UnifiedSingleViewIphone1.exe

@brendanzagaeski
brendanzagaeski / CustomRootElement.cs
Created August 8, 2013 03:00
A custom RootElement subclass to detect when the TableView has scrolled past "maxRows", and so should load more rows
using System;
using MonoTouch.Dialog;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
namespace MTDialogViewControllerTest
{
public class CustomRootElement : RootElement
{
public CustomRootElement (string caption, Group group) : base (caption, group)
@brendanzagaeski
brendanzagaeski / gist:6237091
Created August 15, 2013 00:12
Some command line piping using `monodis` to find files that reference outdated, unsigned `monotouch` assemblies.
find . -iname '*.dll' | while read FILE; do monodis --assemblyref "$FILE" | sed -n '/monotouch/ { N; N; p; }' | grep -iq 'Zero sized public key' && echo "$FILE"; done
@brendanzagaeski
brendanzagaeski / gist:6547582
Created September 13, 2013 07:16
Work-around for incorrectly generated abstract Next() method
using System;
using Android.Runtime;
namespace Com.Nostra13.Universalimageloader.Core.Assist.Deque
{
public partial class LinkedBlockingDeque
{
public partial class DescendingItr
{
static IntPtr id_next;
@brendanzagaeski
brendanzagaeski / desc.xml
Created September 18, 2013 15:26
XML descriptor file to preserve MonoTouch.GLKit.GLKView
<linker>
<assembly fullname="monotouch">
<type fullname="MonoTouch.GLKit.GLKView" />
</assembly>
</linker>
@brendanzagaeski
brendanzagaeski / desc.xml
Created October 14, 2013 18:25
Preserve WebConfigurationHost constructors during linking
<linker>
<assembly fullname="System.Web">
<type fullname="System.Web.Configuration.WebConfigurationHost">
<method name=".ctor" />
</type>
</assembly>
</linker>
@brendanzagaeski
brendanzagaeski / System.Runtime.Serialization.patch
Created October 23, 2013 19:17
Proposed fixes for bugs in System.Runtime.Serialization
diff --git a/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs b/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs
index f3c707e..8e713d7 100755
--- a/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs
+++ b/System.Runtime.Serialization/System.Runtime.Serialization/DataContractSerializer.cs
@@ -248,8 +248,10 @@ namespace System.Runtime.Serialization
return;
Type elementType = type;
- if (type.HasElementType)
+ if (type.HasElementType) {
@brendanzagaeski
brendanzagaeski / TableHeaderViewTest.cs
Created October 24, 2013 23:36
TableHeaderView example for MonoTouch.Dialog
public partial class AppDelegate : UIApplicationDelegate
{
public override UIWindow Window {
get;
set;
}
RootElement MyRootElement;
UIViewController RootViewController;
UINavigationController NavigationController;