Skip to content

Instantly share code, notes, and snippets.

Andrew Sardone andrewsardone

Block or report user

Report or block andrewsardone

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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="//" 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
<script async
andrewsardone / imperative.m
Last active Aug 29, 2015
Animating UILabel
View imperative.m
static void *kContext = &kContext;
- (void)viewDidLoad
[super viewDidLoad];
[self.viewModel addObserver:self

Keybase proof

I hereby claim:

  • I am andrewsardone on github.
  • I am 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 / gist:9993488
Last active Aug 29, 2015
Desired assertion for testing that KVO info isn't leaked when system-under-test is dealloc'd
View gist:9993488
@interface FooKVOTests : SenTestCase
@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.


View defuns.el
(defun markdown-custom ()
(add-hook 'markdown-mode-hook '(lambda() (markdown-custom)))
(provide 'defuns)
View gist:107299
#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];
View callbacks.rb
# Cookie cutter code from ActiveRecord::Callbacks
# Adds before_move and after_move callbacks for the awesome_nested_set
# plugin by Collective Idea
# RAILS_ROOT/vendor/plugins/awesome_nested_set_extensions/lib/callbacks.rb
module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
View gist:130895
# 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
s.join(" ")
View gist:167172
$ 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/ (File name too long)
You can’t perform that action at this time.