Skip to content

Instantly share code, notes, and snippets.

View ashfurrow's full-sized avatar

Ash Furrow ashfurrow

View GitHub Profile
@ashfurrow
ashfurrow / gist:1867086
Created February 20, 2012 01:34
Getting Growl Framework to link properly against a Plugin Bundle in Xcode

Add the following as a Build Phase Run Script. Borrowed from GrowlMail, except quotes were added around the arguments to install_name_tool since our project has a space in the name.

install_name_tool -change "@executable_path/../Frameworks/Growl.framework/Versions/A/Growl" "@loader_path/../Frameworks/Growl.framework/Versions/A/Growl" "$BUILT_PRODUCTS_DIR/$EXECUTABLE_PATH"

install_name_tool -id "@loader_path/../Frameworks/Growl.framework/Versions/A/Growl" "$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME/Contents/Frameworks/Growl.framework/Growl"

Here's a (lengthy) explanation of why this is necessary.

@ashfurrow
ashfurrow / gist:1935760
Created February 28, 2012 22:37
Write both files to disk
NSRect offscreenRect = NSMakeRect(0.0, 0.0, 20.0, 12.0);
NSBitmapImageRep* bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil
pixelsWide:offscreenRect.size.width
pixelsHigh:offscreenRect.size.height
bitsPerSample:8
samplesPerPixel:4
hasAlpha:YES
isPlanar:NO
colorSpaceName:NSCalibratedRGBColorSpace
bitmapFormat:0
@ashfurrow
ashfurrow / gist:2140332
Created March 20, 2012 19:36
500px iOS Developer Job Description

iOS Developer

The 500px team is growing and we're looking for another iOS developer. You need to be able to work at 500px HQ at the corner of Peter and Adelaide in beautiful Toronto, Ontario.

Qualifications

  • Excellent communication skills
  • A history of shipping iOS software
  • Ability to write idiomatic Objective-C code
  • Deep understanding of Cocoa design patterns and API design
@ashfurrow
ashfurrow / gist:2431499
Created April 20, 2012 20:11
Photo Walk April 21st
  • Meet at 500px World HQ downstairs lobby at 4pm (317 Adelaide St. West)
  • Taxi up to DVP at http://g.co/maps/6hg84
  • Take amazing photos

Please tweet to @ashfurrow to confirm your attendance.

class MyClass {
var example: String = ""
}
let a = MyClass()
// The state of a is that example is ""
a.example = "hi"

It's been over a year since developers began using Swift to write iOS applications, and we've seen the Cocoa community expand in all directions in an effort to discover the best practices of Swift. Some of these explorations have been fruitful, and some have not. This talk presents advice to help you distinguish between what's cool and what's smart. Between substance and hype. Bring an open mind.

import UIKit
protocol LocationManagerDelegate {
func retrievedMapLocation(location: Int)
}
class LocationManager {
var delegate: LocationManagerDelegate?
func getLocations() {
self.gitHubCommand = [RACCommand command];
self.gitHubSignal = [self.gitHubCommand addSignalBlock:^RACSignal *(id value) {
RACReplaySubject *subject = [RACReplaySubject subject];
[engine teamsInOrganization:@"TeehanLax" withSuccess:^(id result) {
for (NSDictionary *team in result)
{
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
@ashfurrow
ashfurrow / gist:5404679
Last active December 16, 2015 08:19
Subscribing to a text field's signal
[self.textField.rac_textSignal subscribeNext:^(NSString *value) {
NSLog(@"Text field has been updated: %@", value);
}];