Skip to content

Instantly share code, notes, and snippets.

View andrewsardone's full-sized avatar

Andrew Sardone andrewsardone

View GitHub Profile

Here's a quick attempt at trying to build off of some quick tweets:

@cdzombak @vitalekj @a_j_r nice! Another underlying point is that the delegate example is easy. I've seen experienced devs struggle w/ it.

— Andrew Sardone (@andrewa2) February 15, 2014
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

@cdzombak @vitalekj @a_j_r I think many devs' love of callbacks helps demonstrate this

— Andrew Sardone (@andrewa2) February 15, 2014
@andrewsardone
andrewsardone / imperative.m
Last active August 29, 2015 13:56
Animating UILabel
static void *kContext = &kContext;
- (void)viewDidLoad
{
[super viewDidLoad];
[self.viewModel addObserver:self
forKeyPath:@"instructionText"
options:NSKeyValueObservingOptionInitial
context:kContext];

Keybase proof

I hereby claim:

  • I am andrewsardone on github.
  • I am andrewsardone (https://keybase.io/andrewsardone) on keybase.
  • I have a public key whose fingerprint is 7138 F183 6AAB D05C 361F 4FB6 EBDC 1C42 BA58 1B68

To claim this, I am signing this object:

@andrewsardone
andrewsardone / gist:9993488
Last active August 29, 2015 13:58
Desired assertion for testing that KVO info isn't leaked when system-under-test is dealloc'd
@interface FooKVOTests : SenTestCase
@end
@implementation FooKVOTests
#pragma mark Observation info leak regression
- (void)test_observation_info_is_not_leaked
{
Foo *__weak foo = [Foo new]; // dealloc foo immediately

Thoughts and complaints on GarageBand 10

I just recently started using GarageBand 10 for the first time since its October 2013 release. Up until now I had been doing occasional work in GarageBand 6.0.5, from the iLife ‘11 suite (also known as GarageBand 11, which isn’t confusing at all).

I decided it was time to get on the “newer is better” bandwagon and [start a new project][coptp] in GarageBand 10. Historically GarageBand has been one of my favorite Apple apps because I’ve used it a lot for some really fun tasks (read: making songs with my high school and college bands). Because of this, I was eager to try GarageBand 10 for superficial reasons (cleaner look, retina assets FTW), but thinking that it’s previously been a relatively strong app that they’ve probably only made it better.

Boy, was I wrong.

Disclaimer

(defun markdown-custom ()
"markdown-mode-hook"
(longlines-mode))
(add-hook 'markdown-mode-hook '(lambda() (markdown-custom)))
(provide 'defuns)
#import "AppController.h"
@implementation AppController
- (void)awakeFromNib {
NSMenu *menu = [self createMenu];
menuItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:24] retain];
[menuItem setImage:[NSImage imageNamed:@"41-picture-frame"]];
[menuItem setTarget:self];
# Cookie cutter code from ActiveRecord::Callbacks
# Adds before_move and after_move callbacks for the awesome_nested_set
# plugin by Collective Idea
# http://github.com/collectiveidea/awesome_nested_set/tree/master
#
# RAILS_ROOT/vendor/plugins/awesome_nested_set_extensions/lib/callbacks.rb
module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
# text_children_of_element(REXML::XPath.first(node, query))
def text_children_of_element(e, s=[])
if e.has_elements?
s << ""
e.each_element { |el| text_value_of_element(el,s) }
elsif e.has_text?
s << e.text.chomp
end
s.join(" ")
$ git checkout -f 03712e55d876484c383c13422bd4f26f34c59a82
FATAL: Could not checkout 03712e55d876484c383c13422bd4f26f34c59a82
Command returned status code 1: error: git checkout-index: unable to create symlink product/mms/conf/mms.props.www.vm.nejm.org.xml (File name too long)