Skip to content

Instantly share code, notes, and snippets.

View aaronbrethorst's full-sized avatar

Aaron Brethorst aaronbrethorst

View GitHub Profile
@aaronbrethorst
aaronbrethorst / gist:3696661
Created September 11, 2012 07:24
Open Source Licenses for YouTube iOS App
Notices for libraries
TBXML
Copyright 2012 71Squared All rights reserved.
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
require 'rubygems'
require 'active_support/core_ext'
class Fixnum
def score
self * 20
end
def and
self
@aaronbrethorst
aaronbrethorst / t2p.rb
Created May 16, 2011 02:32
Twitter Timeline to Cocoa plist
require 'rubygems'
require 'json'
require 'plist'
require 'open-uri'
File.open("/Users/aaron/Desktop/tweets.plist", 'w') {|f| JSON.parse(open("http://api.twitter.com/1/statuses/user_timeline.json?screen_name=cocoacontrols").read).to_plist}
- (id)initWithFrame:(CGRect)aFrame
{
if ((self = [super initWithFrame:aFrame]))
{
imageView = [[UIImageView alloc] initWithFrame:CGRectMake(11, 11, 48, 48)];
imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView.layer.cornerRadius = 3.f;
imageView.layer.masksToBounds = YES;
imageView.layer.shadowColor = [[UIColor blackColor] CGColor];
imageView.layer.shadowOffset = CGSizeMake(0, 3);
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGFloat minx = CGRectGetMinX(rect);
CGFloat midx = CGRectGetMidX(rect);
CGFloat maxx = CGRectGetMaxX(rect);
CGFloat miny = CGRectGetMinY(rect);
CGFloat midy = CGRectGetMidY(rect);
CGFloat maxy = CGRectGetMaxY(rect);
@aaronbrethorst
aaronbrethorst / gist:973494
Created May 15, 2011 20:17
RoundedUITableView Corner Radius
diff --git a/Classes/RoundedUITableView.m b/Classes/RoundedUITableView.m
index 80eddf1..53904a9 100644
--- a/Classes/RoundedUITableView.m
+++ b/Classes/RoundedUITableView.m
@@ -30,6 +30,7 @@
#import "RoundedUITableView.h"
#import <QuartzCore/QuartzCore.h>
+#define kCornerRadius 6.f
-- (id)initWithFrame:(CGRect)frame {
- if (self = [super initWithFrame:frame]) {
+- (id)initWithFrame:(CGRect)frame style:(UITableViewStyle)aTableStyle {
+ if (self = [super initWithFrame:frame style:aTableStyle]) {
[self setupView];
}
diff --git a/Classes/MenuViewController.m b/Classes/MenuViewController.m
index 7254ccc..47fd8df 100755
--- a/Classes/MenuViewController.m
+++ b/Classes/MenuViewController.m
@@ -28,14 +28,7 @@
[_tableView setDataSource:self];
[_tableView setBackgroundColor:[UIColor clearColor]];
_tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 1)];
- [self.view addSubview:_tableView];
-