Skip to content

Instantly share code, notes, and snippets.

View tonyarnold's full-sized avatar

Tony Arnold tonyarnold

View GitHub Profile
[notificationCenter addObserverForName:AppleMenuTransparencyDidChangeNotification object:nil block:^(NSNotification * notification)
{
RunAfterDelay(0.25, ^{[self HSSpaceController_setSpaceMenuBarStateUsingSystem:self.activeSpace];});
}
];
AddType application/x-javascript .js
### Symphony 2.0.x ###
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
### DO NOT APPLY RULES WHEN REQUESTING "favicon.ico"
RewriteCond %{REQUEST_FILENAME} favicon.ico [NC]
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xb0c92ab0
[Switching to process 191 thread 0x5903]
0x95d299e3 in sseCGSFill8by1 ()
(gdb) bt
#0 0x95d299e3 in sseCGSFill8by1 ()
#1 0x943a5d36 in view_clear_region ()
#2 0x943a0c9c in view_draw ()
#3 0x943af9cb in view_display_link ()
#4 0x943a13a1 in link_callback ()
==55447== Mismatched free() / delete / delete []
==55447== at 0x100175531: operator delete(void*) (vg_replace_malloc.c:387)
==55447== by 0x1067AF54C: BindingTable::~BindingTable() (in /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib)
==55447== by 0x1067B1D65: TGenericLinker::~TGenericLinker() (in /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib)
==55447== by 0x1067858BF: ShDestruct (in /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib)
==55447== by 0x11FD4B1F7: gleFreeProgramObject (in /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLEngine.bundle/GLEngine)
==55447== by 0x11FD3137C: gleUnbindDeleteHashNameAndObject (in /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLEngine.bundle/GLEngine)
==55447== by 0x11FCB7CBB: glDeleteObjectARB_Exec (in /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLEngine.bundle/GLEng
@tonyarnold
tonyarnold / gist:472093
Created July 12, 2010 03:17
Custom sort descriptor compare method
@interface NSString (GroupComparison)
- (NSComparisonResult)groupCompare:(NSString *)otherGroup;
@end
@implementation NSString (GroupComparison)
- (NSComparisonResult)groupCompare:(NSString *)otherGroup {
@tonyarnold
tonyarnold / gist:472094
Created July 12, 2010 03:18
Dr. Tran's Hickory Chicken Sortables
NSSortDescriptor *groupSortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"group" ascending:YES selector:@selector(groupCompare:)] autorelease];
NSSortDescriptor *orderSortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"order" ascending:YES] autorelease];
NSArray *descriptors = [NSArray arrayWithObjects:groupSortDescriptor, orderSortDescriptor, nil];
NSArray *sortedShortcuts = [allShortcuts sortedArrayUsingDescriptors:descriptors];
// Re-sort the group name string objects (they've just been jumbled on Leopard - YAY!)
NSSortDescriptor *groupObjectSortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"self" ascending:YES selector:@selector(groupCompare:)] autorelease];
NSMutableArray *distinctGroupNames = [sortedShortcuts valueForKeyPath:@"@distinctUnionOfObjects.group"];
NSArray *sortedDistinctGroupNames = [distinctGroupNames sortedArrayUsingDescriptors:[NSArray arrayWithObject:groupObjectSortDescriptor]];
//
// UIView+CommonDrawing.h
// Contacts Plus
//
// Created by Tony Arnold on 4/08/10.
// Copyright 2010 The CocoaBots. All rights reserved.
//
#import <Foundation/Foundation.h>
<input class="checkbox" type="checkbox" name="terms-and-conditions" validate="required:true"/>
<label for="terms-and-conditions">I agree to the <a href="">Terms and Conditions</a></label>
<label for="terms-and-conditions" class="error block">You must accept the terms and conditions</label>
require 'formula'
class Mysql <Formula
version '5.5.6-rc'
homepage 'http://dev.mysql.com/doc/refman/5.5/en/'
url 'http://mysql.mirrors.ilisys.com.au/Downloads/MySQL-5.5/mysql-5.5.6-rc.tar.gz'
md5 '25cbd495e3aa87b4eb741b213b6dd990'
depends_on 'readline'
<?php
$filters = is_array($fields['filters']) ? $fields['filters'] : array();
$options = array(
array('admin-only', @in_array('admin-only', $filters]), __('Admin Only')),
array('send-email', @in_array('send-email', $filters), __('Send Email')),
array('expect-multiple', @in_array('expect-multiple', $filters), __('Allow Multiple')),
);