Skip to content

Instantly share code, notes, and snippets.

@woolsweater
woolsweater / PropInCat.m
Created July 11, 2013 19:49
Getting metadata for property in category.
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
@interface Rigby : NSObject
@end
@implementation Rigby
@end
@interface Rigby (Eleanor)
@woolsweater
woolsweater / DispatchQueueThreads.m
Created June 28, 2013 04:38
Background queues sometimes execute their blocks on the main thread.
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_sync(q, ^{
NSLog(@"Sync on main: %@", [NSThread isMainThread] ? @"YES" : @"NO");
@woolsweater
woolsweater / nowplaying.py
Last active December 12, 2015 12:39
Display recently played tracks on All Classical.
import sys
import urllib
import re
import argparse
from datetime import datetime, timedelta
from bs4 import BeautifulSoup
parser = argparse.ArgumentParser(description="Display recently played tracks on All Classical.")
parser.add_argument("-p", "--performer", action="store_true",
help="Include performer information in output")
@woolsweater
woolsweater / FortHill.h
Last active December 12, 2015 07:09
Private ivar that is accessible in subclasses.
#import "Monongahela.h"
@interface FortHill : Monongahela
@end