Skip to content

Instantly share code, notes, and snippets.

View ellneal's full-sized avatar
👨‍💻
Focusing on Swifty things

Elliot ellneal

👨‍💻
Focusing on Swifty things
View GitHub Profile
@ellneal
ellneal / Gemfile
Created March 20, 2016 16:52 — forked from sr/Gemfile
Janky on Heroku
source "http://rubygems.org"
gem "janky", "~>0.9"
gem "pg"
gem "thin"

Keybase proof

I hereby claim:

  • I am ellneal on github.
  • I am ellneal (https://keybase.io/ellneal) on keybase.
  • I have a public key whose fingerprint is 2A9F FF76 88FF 3A82 C35A 8835 37F4 6F2C E0D7 4DD3

To claim this, I am signing this object:

@ellneal
ellneal / gist:2557400
Created April 30, 2012 11:06
Static View at top of UIScrollView - place in layoutSubviews
UIView *staticHeaderView = <#static view#>;
CGRect visibleBounds = self.bounds;
CGRect staticHeaderFrame = staticHeaderView.frame;
CGRect contentRect = CGRectMake(0, 0, self.contentSize.width, self.contentSize.height);
if (CGRectGetMinY(visibleBounds) < CGRectGetMinY(contentRect)) {
staticHeaderFrame = CGRectMake(visibleBounds.origin.x, CGRectGetMinY(contentRect), staticHeaderFrame.size.width, staticHeaderFrame.size.height);
}
@ellneal
ellneal / gist:2557391
Created April 30, 2012 11:04
Static View at bottom of UIScrollView - place in layoutSubviews
UIView *staticFooterView = <#static view#>;
CGRect visibleBounds = self.bounds;
CGRect staticFooterFrame = staticFooterView.frame;
CGRect contentRect = CGRectMake(0, 0, self.contentSize.width, self.contentSize.height);
if (CGRectGetMaxY(visibleBounds) > CGRectGetMaxY(contentRect)) {
staticFooterFrame = CGRectMake(visibleBounds.origin.x, CGRectGetMaxY(contentRect) - staticFooterFrame.size.height, staticFooterFrame.size.width, staticFooterFrame.size.height);
}
@ellneal
ellneal / gist:2375839
Created April 13, 2012 10:55
main() exception trace
@autoreleasepool {
int result = -1;
@try {
result = UIApplicationMain(argc, argv, nil, NSStringFromClass([<#AppDelegateClassName#> class]));
}
@catch (NSException *exception) {
@ellneal
ellneal / gist:2143783
Created March 21, 2012 02:19
Xcode: Compress project exluding git repository (for source code delivery)
VERSION_NUMBER=`/usr/libexec/PlistBuddy -c "print CFBundleVersion" $INFOPLIST_FILE`
DELIVERY_DIRECTORY="$PROJECT_NAME-$VERSION_NUMBER"
cd $PROJECT_DIR/../
mkdir $DELIVERY_DIRECTORY
rsync -av --exclude='.git' $PROJECT_DIR $DELIVERY_DIRECTORY
tar -zcvf $DELIVERY_DIRECTORY.tar.gz $DELIVERY_DIRECTORY
rm -rf $DELIVERY_DIRECTORY
@ellneal
ellneal / gist:2049684
Created March 16, 2012 11:33
Checkout a remote branch
git checkout -b [LOCAL_BRANCH_NAME] [REMOTE]/[REMOTE_BRANCH_NAME]
@ellneal
ellneal / gist:1393743
Created November 25, 2011 15:14
Create non-retaining NSMutableArray
<#Array Name#> = (NSMutableArray*)CFArrayCreateMutable(NULL, 0, &(const CFArrayCallBacks){0,NULL,NULL,NULL,NULL});
@ellneal
ellneal / gist:1082499
Created July 14, 2011 13:56
ADBannerView Show/Hide : Add this to your snippets library for any time you're working with iAd. Simply drop these two methods in your UIViewController subclass, and call them from ADBannerViewDelegate methods, or anywhere else.
#pragma mark - ADBannerView Show/Hide
- (void)showBannerView:(ADBannerView *)bannerView animated:(BOOL)animated {
if ([bannerView superview] != nil)
return;
UIView *bannerSuperview = <#banner superview#>;
UIView *contentView = <#content view#>;