Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Robertson pjrobertson

View GitHub Profile
@pjrobertson
pjrobertson / install-composer.sh
Created Feb 18, 2016 — forked from matthewspencer/install-composer.sh
Install Composer on Webfaction
View install-composer.sh
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
View gist:42390f90857e49dbe8dd
Avon
Bedfordshire
Berkshire
Bristol
Buckinghamshire
Cambridgeshire
Cheshire
Cleveland
Cornwall
Cumbria
View gist:f2156f68a6c6cd2a7a5a
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
View gist:65cd9abba29acb410999
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
View gist:df922342b0742ffaa1d0
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 Feb 28, 2014
Shows how to properly make singletons/sharedInstances in objective-C, using a dispatch_once_t token
View singletons properly
// MyObject.h
@interface MyObject : NSObject
+ (instancetype)sharedInstance;
@end
// MyObject.m
@implementation MyObject
@pjrobertson
pjrobertson / gist:7727497
Created Dec 1, 2013
Memory_history for double freed object in sharedAddressBook
View gist:7727497
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 Dec 1, 2013
sharedAddressBook crash / QS Contacts Plugin backtrace
View gist:7727462
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 Dec 21, 2015
Changes to bpm detector to stop a bug for audio files with silent portions
View gist:6289687
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:
View gist:6112570
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)