Skip to content

Instantly share code, notes, and snippets.

Avatar

Brendan Zagaeski brendanzagaeski

  • Boston, MA, United States
View GitHub Profile
@brendanzagaeski
brendanzagaeski / CustomRootElement.cs
Created Aug 8, 2013
A custom RootElement subclass to detect when the TableView has scrolled past "maxRows", and so should load more rows
View CustomRootElement.cs
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 Aug 15, 2013
Some command line piping using `monodis` to find files that reference outdated, unsigned `monotouch` assemblies.
View gist:6237091
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 Sep 13, 2013
Work-around for incorrectly generated abstract Next() method
View gist:6547582
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 Sep 18, 2013
XML descriptor file to preserve MonoTouch.GLKit.GLKView
View desc.xml
<linker>
<assembly fullname="monotouch">
<type fullname="MonoTouch.GLKit.GLKView" />
</assembly>
</linker>
@brendanzagaeski
brendanzagaeski / desc.xml
Created Oct 14, 2013
Preserve WebConfigurationHost constructors during linking
View desc.xml
<linker>
<assembly fullname="System.Web">
<type fullname="System.Web.Configuration.WebConfigurationHost">
<method name=".ctor" />
</type>
</assembly>
</linker>
@brendanzagaeski
brendanzagaeski / System.Runtime.Serialization.patch
Created Oct 23, 2013
Proposed fixes for bugs in System.Runtime.Serialization
View System.Runtime.Serialization.patch
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 Oct 24, 2013
TableHeaderView example for MonoTouch.Dialog
View TableHeaderViewTest.cs
public partial class AppDelegate : UIApplicationDelegate
{
public override UIWindow Window {
get;
set;
}
RootElement MyRootElement;
UIViewController RootViewController;
UINavigationController NavigationController;
@brendanzagaeski
brendanzagaeski / JSCoreiOSViewController.cs
Created Oct 25, 2013
Use P/Invoke to call JavaScriptCore's C API functions in iOS.
View JSCoreiOSViewController.cs
using System;
using MonoTouch.UIKit;
using MonoTouch;
using System.Runtime.InteropServices;
namespace JintiOS
{
unsafe public partial class JintiOSViewController : UIViewController
{
JSContextRef* context;
View Android.Webkit.WebViewClientClassicExt.cs
using System;
using Android.Runtime;
namespace Android.Webkit {
[global::Android.Runtime.Register ("android/webkit/WebViewClientClassicExt", DoNotGenerateAcw=false)]
public class WebViewClientClassicExt : Android.Webkit.WebViewClient {
public WebViewClientClassicExt () {}
protected WebViewClientClassicExt (IntPtr javaReference, JniHandleOwnership transfer) : base (javaReference, transfer) {}
}
}
@brendanzagaeski
brendanzagaeski / Main.cs
Created Nov 11, 2013
Subclassing NSMutableAttributedString causes an error "[CustomNSAttributedString initWithAttributedString:]: unrecognized selector sent to instance 0x4418b0"
View Main.cs
using System;
using MonoMac.Foundation;
using MonoMac.CoreText;
using MonoMac.AppKit;
namespace SubclassingTest
{
public class Program
{
static void Main (string[] args)
You can’t perform that action at this time.