Skip to content

Instantly share code, notes, and snippets.

View sandyarmstrong's full-sized avatar

Sandy Armstrong sandyarmstrong

View GitHub Profile
public class KeyboardTabBehavior : Behavior<UIElement>
{
private KeyboardTabHelper _keyboardTabHelper;
protected override void OnAttached()
{
base.OnAttached();
_keyboardTabHelper = new KeyboardTabHelper(AssociatedObject);
}
/usr/lib/libc.dylib: 00001567 T _mach_host_self
/usr/lib/libc.dylib: 001b0768 D _mach_host_self_
/usr/lib/libdbm.dylib: 00001567 T _mach_host_self
/usr/lib/libdbm.dylib: 001b0768 D _mach_host_self_
/usr/lib/libdl.dylib: 00001567 T _mach_host_self
/usr/lib/libdl.dylib: 001b0768 D _mach_host_self_
/usr/lib/libdtrace.dylib: U _mach_host_self
/usr/lib/libgcc_s.1.dylib: 00001567 T _mach_host_self
/usr/lib/libgcc_s.1.dylib: 001b0768 D _mach_host_self_
/usr/lib/libinfo.dylib: 00001567 T _mach_host_self
using System;
using System.ComponentModel;
using System.Linq.Expressions;
using System.Reflection;
namespace WovenClient.Extensions
{
// Based on code from http://www.ingebrigtsen.info/post/2008/12/11/INotifyPropertyChanged-revisited.aspx
public static class NotifyPropertyChangedExtensions
{
@sandyarmstrong
sandyarmstrong / gist:1562500
Created January 4, 2012 22:20
so tired of this...
Warning Unresponsive Script
A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
Script: resource://gre/modules/XPCOMUtils.jsm:331
@sandyarmstrong
sandyarmstrong / MultiErrorError.py
Created March 29, 2011 22:58
Custom python exception for printing multiple exceptions
class MultiErrorError(Exception):
'''Gather multiple errors and include all of their info in one exception'''
def __init__(self, msg, errors):
'''Create a MultiErrorError
Arguments:
msg -- text to show in top-level exception after "N errors raised while "
errors -- list of error tuples from calls to sys.exc_info
'''
self.msg = msg
$ python manage.py migrate
Running migrations for sprints:
- Migrating forwards to 0005_milestone_stats_cache_default_vals.
> sprints:0001_initial
> sprints:0002_add_milestone
> sprints:0003_milestone_stats
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/usr/lib/pymodules/python2.6/django/core/management/__init__.py", line 438, in execute_manager
@sandyarmstrong
sandyarmstrong / gist:847535
Created February 28, 2011 16:14
Building dbus-sharp with xbuild on Mono 2.4 (Ubuntu Lucid LTS)
[sys] ~/mono-git/dbus-sharp (alan-master)
$ mono --version
Mono JIT compiler version 2.4.4 (Debian 2.4.4~svn151842-1ubuntu4)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC)
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
filetype plugin indent on
syntax on
@sandyarmstrong
sandyarmstrong / gist:456565
Created June 28, 2010 23:50
wix question
I have this in http://git.gnome.org/browse/tomboy/tree/Setup/Setup.wxs
<Condition Message="This setup requires Gtk# for .NET (version 2.12.8 or higher). Please download the latest installer from http://ftp.novell.com/pub/mono/gtk-sharp/ ">
<![CDATA[GTKSHARPNOVELLINSTALLVERSION >= "2.12.8" OR REMOVE ~= "ALL"]]>
</Condition>
Now unfortunately, because this version check is
a string comparison, when GTKSHARPNOVELLINSTALLVERSION
is "2.12.10", that does not pass the >= "2.12.8" test.
package com.novell.webyast;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.Authenticator;
import java.net.HttpURLConnection;
import java.net.PasswordAuthentication;
import java.net.URL;
public class RestClient {