Skip to content

Instantly share code, notes, and snippets.

View pjrobertson's full-sized avatar

Patrick Robertson pjrobertson

View GitHub Profile
- (NSDictionary *)infoRecord {
NSString *path = [self validSingleFilePath];
if (!path)
return nil;
NSDictionary *dict;
if (dict = [self objectForCache:@"QSItemInfoRecord"])
return dict;
/* Try to get information for this file */
@pjrobertson
pjrobertson / gist:4120859
Created November 20, 2012 20:30
Plex Media Server libxml plugin crash
Process: Python [86444]
Path: /System/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: 2.5.6 (2.5.6a0)
Code Type: X86 (Native)
Parent Process: Plex Media Server [86443]
User ID: 501
PlugIn Path: /Users/USER/Library/Application Support/Plex Media Server/*/Framework.bundle/Contents/Resources/Platforms/MacOSX/i386/Frameworks/libxml2.2-osx.dylib
PlugIn Identifier: libxml2.2-osx.dylib
$ ls -l /System/Library/Frameworks/Python.framework/Versions
drwxr-xr-x 6 root wheel 204 21 Jun 00:23 2.3
drwxr-xr-x 11 root wheel 374 2 Nov 07:20 2.5
drwxr-xr-x 11 root wheel 374 2 Nov 07:21 2.6
drwxr-xr-x 11 root wheel 374 2 Nov 07:21 2.7
lrwxr-xr-x 1 root wheel 3 22 Jul 03:25 Current -> 2.7
$ python
Python 2.7.2 (default, Jun 20 2012, 16:23:33)
patrick$ cat a.php
<?php
echo (TRUE ? "a" : (TRUE ? "b" : "c"))."\n";
?>
patrick$ php a.php
a
@pjrobertson
pjrobertson / gist:4503804
Created January 10, 2013 17:02
Quicksilver ß71 crash report
Process: Quicksilver [29345]
Path: /Applications/Quicksilver.app/Contents/MacOS/Quicksilver
Identifier: com.blacktree.Quicksilver
Version: ß71 (3938)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
User ID: 501
Date/Time: 2013-01-09 15:59:13.336 -0800
OS Version: Mac OS X 10.8.2 (12C3006)
@pjrobertson
pjrobertson / gist:4662674
Created January 29, 2013 08:24
Terminal command for clearing launch services on OS X. (Mountain Lion) Original from http://hints.macworld.com/article.php?story=20031215144430486
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
@pjrobertson
pjrobertson / Threading FileManager
Created February 12, 2013 20:51
Test app for whether or not -[NSFileManager defaultManager] returns the same instance on different thread (it does)
//
// main.m
// Threading
//
// Created by Patrick Robertson on 12/02/2013.
// Copyright (c) 2013 Patrick Robertson. All rights reserved.
//
#import <Foundation/Foundation.h>
@pjrobertson
pjrobertson / gist:4999420
Created February 20, 2013 20:41
Test on the LLVM compiler optimisation
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
// insert code here...
NSURL *url = [NSURL fileURLWithPath:@"file://localhost/usr/bin/"];
NSMutableArray *a = [NSMutableArray array];
@pjrobertson
pjrobertson / gist:5015682
Created February 22, 2013 18:53
Firefox plugin for Quicksilver exception
2013-02-22 18:53:06.382 Quicksilver[29383:303] *** -[JKArray objectAtIndex:]: index (18446744073709551615) beyond bounds (1)
2013-02-22 18:53:06.384 Quicksilver[29383:303] (
0 CoreFoundation 0x00007fff91b070a6 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff934bc3f0 objc_exception_throw + 43
2 CoreFoundation 0x00007fff91b9b229 -[NSException raise] + 9
3 ExceptionHandling 0x00000001002b365b NSExceptionHandlerExceptionRaiser + 210
4 libobjc.A.dylib 0x00007fff934bc3f0 objc_exception_throw + 43
5 CoreFoundation 0x00007fff91b06e7c +[NSException raise:format:] + 204
6 Firefox Module 0x0000000103b2e2e0 sqlite3_uri_parameter + 1278
7 QSCore 0x0000000100197b5b -[QSProxyObject resolvedObject] + 43
## Plugins built against commit bb8ec2ef2588e818e062af467d4d49945e102777 or later are 64 bit only. Set the QSVersion to ensure these plugins don't show up in the plugin updater
qsversion = info.get('QSRequirements',{}).get('version','')
if qsversion == '' or hex(qsversion) < 0x4001:
qsversion.setdefault('QSRequirements',{})['version'] = '4001'