This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import Random | |
class IndependentRepeatableRandom(object): | |
def __init__(self): | |
self.randgen = Random() | |
self.origstate = self.randgen.getstate() | |
def random(self, val): | |
self.randgen.jumpahead(int(val)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface Deleg : NSObject | |
+ (void)delegatorDidSomething; | |
- (void)delegatorDidSomething; | |
@end | |
@implementation Deleg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Demo of backing class properties with a dictionary instead of individual | |
* ivars. | |
* | |
* http://stackoverflow.com/questions/29158157/ | |
* | |
* Created by Josh Caswell on 3/19/15. | |
* Released to the public domain on that date. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "Monongahela.h" | |
@interface FortHill : Monongahela | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
@interface Rigby : NSObject | |
@end | |
@implementation Rigby | |
@end | |
@interface Rigby (Eleanor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if !__has_feature(objc_arc) | |
#define __unsafe_unretained | |
#define __bridge | |
#endif | |
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import urllib | |
from base64 import b64decode | |
from zipfile import ZipFile | |
from cStringIO import StringIO | |
from uuid import uuid4 as uuid | |
import editor | |
import console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command script import ~/.lldbscripts/break_unsatisfiable.py |
OlderNewer