Skip to content

Instantly share code, notes, and snippets.

View atomicbird's full-sized avatar

Tom Harrington atomicbird

View GitHub Profile
Processes: 108 total, 11 running, 3 stuck, 94 sleeping, 460 threads 15:25:14
Load Avg: 18.75, 18.89, 16.93 CPU usage: 23.79% user, 76.20% sys, 0.0% idle
SharedLibs: 3040K resident, 8776K data, 0B linkedit.
MemRegions: 21237 total, 916M resident, 24M private, 316M shared.
PhysMem: 494M wired, 992M active, 465M inactive, 1951M used, 96M free.
VM: 246G vsize, 1042M framework vsize, 928980(118) pageins, 308376(0) pageouts.
Networks: packets: 5275551/3179M in, 5122821/3826M out.
Disks: 2100108/53G read, 3549472/35G written.
PID COMMAND %CPU TIME #TH #WQ #POR #MREG RPRVT RSHRD RSIZE
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:@"addsubapp+.png"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(doSomethingCool)]
autorelease];
Dear H--------
Sequel to your non response of my earlier letter to you
I am the Trustee and Executor to the Will of my late client
Mr Morris H--------, Who before his death deposited the sum
of Seventeen Million United States Dollars in a bank here
in Budapest, Hungary.
I have been unsuccessful in locating his relatives for over
three years and the Bank has instructed me to present his
- (void)loadView {
NSLog(@"!!@#$!@#$!@#$!@#$!@#$!@#$!@#$!@#$");
self.wantsFullScreenLayout = YES;
CGRect f = CGRectZero;
f = [UIScreen mainScreen].applicationFrame;
UIView *container = [[UIView alloc] initWithFrame:f];
#!/bin/bash
# Convert man pages to PDF and open them in the default PDF viewer.
# PDFs are cached when created.
# By Tom Harrington, tph at atomicbird dot com, 16 March 2005
# Directory to save cached PDFs in
# (if you don't want long-term caching, you could use /tmp/).
CACHEDIR=~/Library/Caches
if (success)
{
short i;
i++;
}
@atomicbird
atomicbird / NSObject+setValuesForKeysWithJSONDictionary.h
Created January 11, 2012 02:35
NSObject category for handling JSON dictionaries. Described in detail at http://www.cimgf.com/2012/01/11/handling-incoming-json-redux/
//
// NSObject+setValuesForKeysWithJSONDictionary.h
// SafeSetDemo
//
// Created by Tom Harrington on 12/29/11.
// Copyright (c) 2011 Atomic Bird, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
[theCreatingMOC performBlockAndWait:^{
// Insert some test data...
NSManagedObject *thePerson = [NSEntityDescription insertNewObjectForEntityForName:@"Person" inManagedObjectContext:theCreatingMOC];
[thePerson setValue:@"Steve Jobs" forKey:@"name"];
NSManagedObject *theCompany = [NSEntityDescription insertNewObjectForEntityForName:@"Company" inManagedObjectContext:theCreatingMOC];
[theCompany setValue:@"Apple" forKey:@"name"];
[theCompany setValue:[NSSet setWithObject:thePerson] forKey:@"employees"];
NSManagedObjectContext *theCreatingMOC = theChildMOC;
[theCreatingMOC performBlockAndWait:^{
// Insert some test data...
NSManagedObject *thePerson = [NSEntityDescription insertNewObjectForEntityForName:@"Person" inManagedObjectContext:theCreatingMOC];
[thePerson setValue:@"Steve Jobs" forKey:@"name"];
NSManagedObject *theCompany = [NSEntityDescription insertNewObjectForEntityForName:@"Company" inManagedObjectContext:theCreatingMOC];
[theCompany setValue:@"Apple" forKey:@"name"];
@atomicbird
atomicbird / half-past-midnight.m
Created May 7, 2012 21:27
Half past midnight
#import <Foundation/Foundation.h>
// Get an NSDate representing 30 minutes past midnight in an arbitrary time zone, and print it in a readable form.
// Tom Harrington, tph@atomicbird.com
int main(int argc, char *argv[]) {
NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init];
NSString *timeZoneName = @"America/New_York";
NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:timeZoneName];