Skip to content

Instantly share code, notes, and snippets.

View kevinmcmahon's full-sized avatar

Kevin McMahon kevinmcmahon

View GitHub Profile
package com.example.common;
import android.os.Handler;
import android.os.Looper;
import com.squareup.otto.Bus;
public class AndroidBus extends Bus {
private final Handler mainThread = new Handler(Looper.getMainLooper());
struct Notifications {
struct ListColorDidChange {
static let name = "ListDidUpdateColorNotification"
static let colorUserInfoKey = "ListDidUpdateColorUserInfoKey"
static let URLUserInfoKey = "ListDidUpdateURLUserInfoKey"
}
}

Keybase proof

I hereby claim:

  • I am kevinmcmahon on github.
  • I am kevinmcmahon (https://keybase.io/kevinmcmahon) on keybase.
  • I have a public key whose fingerprint is 4491 805E 5D79 BCF4 468D FB6D F491 8BE2 AAF0 7673

To claim this, I am signing this object:

* Assertion at ../../../../mono/mini/debugger-agent.c:2767, condition `!tls' not met
Stacktrace:
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0xffffffff>
at MonoTouch.UIKit.UIApplication.Main (string[],string,string) <0x000e8>
at TestApp.Application.Main (string[]) [0x00000] in /Users/kevin/Projects/TestApp/TestApp/Main.cs:11
at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0x000cb>
Native stacktrace:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq") | Out-Null
#specify the root of your source tree below
$path = "C:\Code\chatsworth"
$ns = "http://schemas.microsoft.com/developer/msbuild/2003"
$xname = [System.Xml.Linq.XName]::Get("PropertyGroup",$ns)
$tfname = [System.Xml.Linq.XName]::Get("TargetFrameworkVersion",$ns)
$xws = New-Object System.Xml.XmlWriterSettings
@kevinmcmahon
kevinmcmahon / ObjectiveCParser.cs
Created August 7, 2010 02:38
An Objective C brute force parser from #monotouch irc
// no claim or warranty is made on this code
// it is very brute force
using System;
using System.Collections;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;
@kevinmcmahon
kevinmcmahon / HackMulitpleDetailViews RowSelected Method
Created November 24, 2010 06:23
Totally hack fix to MultipleDetailViews
public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
{
int row = indexPath.Row;
ISubstitutableDetailViewController dvc = null;
if(row == 0)
{
dvc = new FirstDetailView();
}
@kevinmcmahon
kevinmcmahon / GoogleSearchResults.cs
Created March 7, 2011 18:17
POCO representation of GoogleSearchResults JSON
/// Deserialise from JSON
[Serializable]
public class GoogleSearchResults
{
public GoogleSearchResults() { }
public GoogleSearchResults(string _unescapedUrl, string _url, string _visibleUrl, string _cacheUrl, string _title, string _titleNoFormatting, string _content)
{
this.unescapedUrl = _unescapedUrl;
this.url = _url;
this.visibleUrl = _visibleUrl;
@kevinmcmahon
kevinmcmahon / gist:877696
Created March 19, 2011 18:38
MonoTouch Binding Help
NOTE: This is pulled from an email exchange and hopefully will be polished up and published as a blog post at http://blog.kevfoo.com but until then I'll just dump it here in a gist. If you have any questions leave comments or ask them in #monotouch on IRC. (I am klmcmahon on IRC)
<Begin Excerpt>
I'm going to do a quick brain dump and attach some code for a generator that was passed around on the #monotouch IRC channel. This is extremely raw and stream of conscious but probably what will become the blog post when it gets fleshed out better.
Step 1: You _HAVE_ to have a static library that has been compiled without THUMB code being generated. (NOTE: I haven't upgraded to iOS 4.3 tools and XCode yet but apparently this isn't the case anymore since Apple appears to have fixed the bug) There is a linker bug that Apple introduced and has yet to fix that causes problems at compile time when trying to link in static libraries with THUMB enabled. You can run a command via the shell to check the dumped output (here