RAProjectTools
Summary: Just released RAProjectTools, a collection of Ruby and Bash scripts that make your life easier.
sync-resources/sync-resources.rbThe script in
sync-resources.rblooks at your Xcode project, and finds a group named Resources. If it finds one, and the group itself is associated with a directory in your project — for example,Project/Resources— it will attempt to reconcile the contents of the directory with the contents of the group. Files added to the directory will be added to the Xcode group, and files no longer found will have their references removed.It works well against projects with one single target. It’s possible to extend the script so it is more robust. The script uses the Xcodeproj gem from CocoaPods, and the appropriate Bundler magic is already set up for you.
Invoke
sync-resourcesfrom the root-level directory containing your project.
next-versionThe script in
next-versionbumps the version number by one. It works with Git Flow, the awesome branching model for software development, and AGVTool, Apple’s solution for software versioning.It works pretty well if you are already using these tools. Remember to start this script from the
developbranch, and it’ll make a new Git Flow release with the next version number.Invoke
next-versionfrom the root-level directory containing your project.
That’s a fairly sizeable amount of awesome right there.
RATilingBackgroundView
Summary: Just released RATilingBackgroundView which implements a very simple
UIViewsubclass that takes several background tiles, generates more if necessary, and scrolls them with the containingUIScrollView.You’ll find
RATilingBackgroundViewin this project. It needs a delegate to work. Do these things to start using it:
Drop the project into your app as a static library dependency.
Implement
<RATilingBackgroundViewDelegate>:- (CGSize) sizeForTilesInTilingBackgroundView:(RATilingBackgroundView *)tilingBackgroundView; - (UIView *) newTileForTilingBackgroundView:(RATilingBackgroundView *)tilingBackgroundView;It’ll ask about the default size for tiles, and will also ask for new tiles whenever the bounds of its containing view has changed and it has no dequeued tiles to cover the area.
Optionally, set the stretching flags so you can use stretchable images for tiles.
@property (nonatomic, readwrite, assign) BOOL horizontalStretchingEnabled; // YES @property (nonatomic, readwrite, assign) BOOL verticalStretchingEnabled; // NOIf you don’t set any stretching flags, the tiles will be stretched horizontally to the same width of the containing view by default.
For example, if you have a square or rectangular image you’d like to repeat, set both flags to
NO.
Very useful as a counterpart to AQGridView.
RAReactionKit
Summary: Just released RAReactionKit, which lets you do blocks-based KVO and key-path binding between objects, and handles premature deallocation cases gracefully without swizzling
-dealloc. It is spliced from IRFoundations, which has grown too large to be instantly useful in any case.There are three major parts of the Reaction Kit: Bindings, Observings, and Deallocation Monitors. The entire project is built upon ARC and mandates support for weak references. It does not swizzle your
-deallocmethods, and work nicely withNSManagedObjectinstances.Bindings
In
NSObject+RABindings.hyou’ll find these methods added toNSObject:- (void) ra_bind:(NSString *)aKeyPath toObject:(id)anObservedObject keyPath:(NSString *)remoteKeyPath options:(NSDictionary *)options; - (void) ra_unbind:(NSString *)aKeyPath;For now, the binding is strictly one-way. Two-way bindings are very interesting to have, though. :)
You use the binding mechanism like this:
[cell ra_bind:@"someView.elements" toObject:modelObject keyPath:@"someOtherElements" options:@{ RABindingsMainQueueGravityOption: @YES }];There are currently two options keys:
RABindingsMainQueueGravityOption: If it is set to
@YES,RABindingswill take care to asynchronously set the value on the receiver from the main queue. If you have an non-atomic object that gets hit from all the places (mediated with a serial dispatch queue), this can be handy.RABindingsValueTransformerOption: You can pass a
RABindingsValueTransformerblock:typedef id (^RABindingsValueTransformer) (id inOldValue, id inNewValue, NSString *changeKind);This allows you to do some very cheap value transforming, for example between
NSDateandNSString.Observings
In
NSObject+RAObservings.hyou’ll find a bunch of methods added toNSObject:- (id) ra_observe:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context withBlock:(RAObservingsCallback)block; - (void) ra_removeObservingsHelper:(id)aHelper; - (void) ra_removeObserverBlocksForKeyPath:(NSString *)keyPath; - (void) ra_removeObserverBlocksForKeyPath:(NSString *)keyPath context:(void *)context; - (NSMutableArray *) ra_observingsHelperBlocksForKeyPath:(NSString *)aKeyPath; - (void) ra_observeObject:(id)target keyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context withBlock:(RAObservingsCallback)block;The main reason for exposure are two-fold:
- The code was written by a more naïve version of myself
- Observings are assumed to be frequently made and broken.
You use the Observing mechanism by invoking
ra_observe:options:context:withBlock:. It spins up a temporary, private KVO listener which forwards incoming communication from the Key-Value Binding mechanism to your handler block.Deallocation Monitors
The Deallocation Monitor is provided in
NSObject+RALifetimeHelper.h:- (void) ra_performOnDeallocation:(void(^)(void))aBlock;If you pass a block to
-ra_performOnDeallocation:, the block will be called when the object is deallocated.Please note that for static NSString instances (the
@""string literals you specified in code), or special cases like@YESand@NO, they will never be deallocated.If you have zombies on, nothing will be deallocated — as well.
Looks very interesting indeed.
Squashed: Mitt Romney thinks you need to take responsibility for your life
Via Marco— squashed : Mitt Romney thinks you need to take responsibility for your life:
Generally, there’s nothing wrong with asking people to take responsibility for their actions to avoid social ills. Stop littering. Spay or neuter your pets. Vaccinate your children. Get up early enough to eat breakfast so you’re not so grouchy at work. If your diet is making you sick, change it….
Apparently anyone earning less than 3x the minimum wage is an underachiever, and thus not worthy of the Republican candidate’s attention…
“”Some of the briefs again reminded Mr. Bush that the attack timing was flexible, and that, despite any perceived delay, the planned assault was on track.
Yet, the White House failed to take significant action. Officials at the Counterterrorism Center of the C.I.A. grew apoplectic. On July 9, at a meeting of the counterterrorism group, one official suggested that the staff put in for a transfer so that somebody else would be responsible when the attack took place, two people who were there told me in interviews. The suggestion was batted down, they said, because there would be no time to train anyone else.
That same day in Chechnya, according to intelligence I reviewed, Ibn Al-Khattab, an extremist who was known for his brutality and his links to Al Qaeda, told his followers that there would soon be very big news. Within 48 hours, an intelligence official told me, that information was conveyed to the White House, providing more data supporting the C.I.A.’s warnings. Still, the alarm bells didn’t sound.
WIL WHEATON dot TUMBLR: Catan Junior - For ages four and up!
I’ve been playing Catan for years and it was nice to see it featured on Tabletop. Being the father of a rapidly evolving, small humanoid, I of course want to start impressing upon him my love of board games.
This past week, at GenCon, I got the opportunity to try out Catan…
My daughter is four right now… I therefore need this game. Like, *medically need* it.
“”You see, what I said was, “If it’s a legitimate rape, the female body has ways to try to shut that whole thing down.” But what I meant to say was, “I am a worthless, moronic sack of shit and an utterly irredeemable human being who needs to shut up and go away forever.”
It is clear to me now that I did not choose my words with care and did not get across the point I was trying to convey. In hindsight, I guess instead of using the words “legitimate rape,” I should have used the words “I am an unforgivable, unrepentant, and unconscionable subhuman dickhead.” Or better yet, “I am an evil, fucked-up man who should never have been elected to the United States Congress, and anyone who would vote for me is probably a pretty big fucking dumbshit, too.” See how much more sense that makes? It’s amazing how a few key word changes can totally alter the meaning of a statement.
Because, of course, it’s all about context. And yes, when you take what I said out of context, I can see how it might sound like I’m denying that women can be impregnated via rape. This is, I assure you, not what I was trying to express at all. Such is the age we live in that one little sentence excerpted in a news report can come back to haunt a person in a pretty big hurry. But if you actually go back and look at the remarks closely, you’ll see that what I was actually trying to convey in my statement was that
(1) I am a big fucking idiot,
(2) I am a nauseating slug of a human being who doesn’t deserve to live, and
(3) I am essentially everything that’s wrong with this country and with humanity in general.
Honestly, that’s all I was trying to get across there. It was a simple misunderstanding, really.
I Misspoke—What I Meant To Say Is ‘I Am Dumb As Dog Shit And I Am A Terrible Human Being’ (via wilwheaton)
Gor’ bless the Onion, sir.
(via wilwheaton)
My Sister Paid Progressive Insurance to Defend Her Killer In Court
I’ve been sending out some impertinent tweets about Progressive Insurance lately, but I haven’t explained how they pissed me off. So I will do that here as succinctly as possible. There’s a general understanding that says, “insurance companies— oh they’re awful,” but since Progressive turned their shit hose on my late sister and my parents, I’ve learned some things that really surprised me.
I’ll try to cleave to the facts. On June 19, 2010, my sister was driving in Baltimore when her car was struck by another car and she was killed. The other driver had run a red light and hit my sister as she crossed the intersection on the green light.
This is appalling. Please read the entire thing (it’ll just take a minute) and tell your friends.
Let’s get enough attention focused on this to force Progressive Insurance to do the right thing for Matt and his family.
And if you’re shopping for auto insurance, don’t give your money to this morally bankrupt company.
Words cannot adequately describe this.
For the record, when the rest of the world looks at America’s insurance-based health services, this is what we see. After all, in a social healthcare system the government is on the hook for the costs using taxpayer money. They’re legally obliged to do what’s best for the country and its populace.
The insurance companies are paying using money they bring in as profit, and they’re legally obliged to serve their shareholders by increasing the value of their stock over time.
Which of those is going to care more about healing people, and which is going to care more about saving money?
5 reasons to play D&D
This is great. A guy shares five reasons he wants his children to play D&D.
Reblogging in the hope that my wife will see it & be convinced… ;o)
