Skip to content

Instantly share code, notes, and snippets.

View lukabratos's full-sized avatar
🛠️
Busy building things.

Luka Bratos lukabratos

🛠️
Busy building things.
View GitHub Profile
@lattner
lattner / TaskConcurrencyManifesto.md
Last active April 25, 2024 18:22
Swift Concurrency Manifesto
@Daniel1of1
Daniel1of1 / gist:8937116
Last active August 29, 2015 13:56
Add an accessory to cells in ABPeoplePickerNavigationController
Class ABMemberDataSourceClass = NSClassFromString(@"ABMembersDataSource");
SEL originalTableViewMethodSelector = @selector(tableView:cellForRowAtIndexPath:);
Method originalTableViewMethod = class_getInstanceMethod(ABMemberDataSourceClass, originalTableViewMethodSelector);
SEL newTableViewMethodSelector = @selector(dhc_tableView:cellForRowAtIndexPath:);
IMP newTableViewMethodImp = imp_implementationWithBlock(^UITableViewCell * (id __unused _self, UITableView *tableView, NSIndexPath *indexPath){

Greetings, NSHipsters!

As we prepare to increment our NSDateComponents -year by 1, it's time once again for NSHipster end-of-the-year Reader Submissions! Last year, we got some mind-blowing tips and tricks. With the release of iOS 7 & Mavericks, and a year's worth of new developments in the Objective-C ecosystem, there should be a ton of new stuff to write up for this year.

Submit your favorite piece of Objective-C trivia, framework arcana, hidden Xcode feature, or anything else you think is cool, and you could have it featured in the year-end blowout article. Just comment on this gist below!

Here are a few examples of the kind of things I'd like to see:

  • Using NSStringFromSelector(@selector()) as a safer way to do KVC / KVO / NSCoding.
  • Panic's [rather surprising discovery about the internals of the Lightning Digital AV Adapter](http://www.panic.com/blog/the-lightning-di
@mattt
mattt / alfred-wwdc.url
Last active September 25, 2018 10:01
Alfred ASCIIwwdc Web Search
alfred://customsearch/Search%20WWDC%20Sessions/wwdc/utf8/noplus/http://asciiwwdc.com/search?q={query}
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@kylefox
kylefox / color.m
Created January 27, 2012 17:45
Generate a random color (UIColor) in Objective-C
/*
Distributed under The MIT License:
http://opensource.org/licenses/mit-license.php
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to