Skip to content

Instantly share code, notes, and snippets.

View pjrobertson's full-sized avatar

Patrick Robertson pjrobertson

View GitHub Profile
@pjrobertson
pjrobertson / install-composer.sh
Created February 18, 2016 09:48 — forked from matthewpizza/install-composer.sh
Install Composer on Webfaction
cd $HOME
ln -s `which php54` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php54
echo -e "\n# Composer\nalias composer=\"php54 \$HOME/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile
@pjrobertson
pjrobertson / gist:42390f90857e49dbe8dd
Created November 2, 2014 20:42
Counties list of ebay
Avon
Bedfordshire
Berkshire
Bristol
Buckinghamshire
Cambridgeshire
Cheshire
Cleveland
Cornwall
Cumbria
Process: Quicksilver [8639]
Path: /Applications/Quicksilver.app/Contents/MacOS/Quicksilver
Identifier: com.blacktree.Quicksilver
Version: 1.2.0 (400D)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Quicksilver [8639]
User ID: 501
Date/Time: 2014-08-13 23:59:49.067 -0700
Process: Quicksilver [382]
Path: /Applications/Quicksilver.app/Contents/MacOS/Quicksilver
Identifier: com.blacktree.Quicksilver
Version: 1.2.0 (400D)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Quicksilver [382]
User ID: 501
Date/Time: 2014-08-09 03:06:08.605 +0100
@pjrobertson
pjrobertson / gist:df922342b0742ffaa1d0
Created July 10, 2014 06:40
Django logger settings
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
},
'require_debug_true': {
'()': 'django.utils.log.RequireDebugTrue'
}
@pjrobertson
pjrobertson / singletons properly
Created February 28, 2014 16:13
Shows how to properly make singletons/sharedInstances in objective-C, using a dispatch_once_t token
// MyObject.h
@interface MyObject : NSObject
+ (instancetype)sharedInstance;
@end
// MyObject.m
@implementation MyObject
@pjrobertson
pjrobertson / gist:7727497
Created December 1, 2013 01:28
Memory_history for double freed object in sharedAddressBook
malloc_history Report Version: 2.0
Process: Quicksilver [17364]
Path: /private/tmp/QS/build/Debug/Quicksilver.app/Contents/MacOS/Quicksilver
Load Address: 0x100000000
Identifier: com.blacktree.Quicksilver
Version: 1.1.0:master:Debug (4008)
Code Type: X86-64
Parent Process: debugserver [17363]
Date/Time: 2013-12-01 09:19:26.898 +0800
@pjrobertson
pjrobertson / gist:7727462
Created December 1, 2013 01:21
sharedAddressBook crash / QS Contacts Plugin backtrace
lldb: bt all
thread #1: tid = 0xfc43, 0x00007fff89b5825a libsystem_malloc.dylib`__disk_stack_logging_log_stack + 767, queue = 'com.apple.main-thread
frame #0: 0x00007fff89b5825a libsystem_malloc.dylib`__disk_stack_logging_log_stack + 767
frame #1: 0x00007fff89b528a0 libsystem_malloc.dylib`malloc_zone_malloc + 107
frame #2: 0x00007fff89b53290 libsystem_malloc.dylib`malloc + 42
frame #3: 0x00007fff82ca46a3 libsystem_c.dylib`_vasprintf + 384
frame #4: 0x00007fff82c9c0fb libsystem_c.dylib`asprintf + 186
frame #5: 0x00007fff8b8fd525 CoreFoundation`-[NSObject(NSObject) __dealloc_zombie] + 85
frame #6: 0x00007fff8b7d8b9b CoreFoundation`-[__NSArrayM dealloc] + 379
@pjrobertson
pjrobertson / gist:6289687
Last active December 21, 2015 10:08
Changes to bpm detector to stop a bug for audio files with silent portions
import wave, array, math, time, argparse, sys
import numpy, pywt
from scipy import signal
import pdb
import matplotlib.pyplot as plt
def read_wav(filename):
#open file, get metadata for audio
try:
@pjrobertson
pjrobertson / gist:6112570
Created July 30, 2013 12:44
QS ARC crash
Process: Quicksilver [15721]
Path: /Applications/Quicksilver.app/Contents/MacOS/Quicksilver
Identifier: com.blacktree.Quicksilver
Version: 1.0.0:arc (4000)
Code Type: X86-64 (Native)
Parent Process: launchd [306]
User ID: 501
Date/Time: 2013-07-30 20:23:15.912 +0800
OS Version: Mac OS X 10.8.4 (12E55)