Skip to content

Instantly share code, notes, and snippets.

View DavidBarry's full-sized avatar

David Barry DavidBarry

View GitHub Profile
@DavidBarry
DavidBarry / SDViewWithNibLayout.h
Created January 22, 2012 12:40
This is a subclass of UIView to reduce boilerplate code when using Interface Builder to layout a custom UIView subclass.
#import <UIKit/UIKit.h>
@interface SDViewWithNibLayout : UIView
+ (id)viewFromNib;
+ (NSString *)nibName;
@end
@DavidBarry
DavidBarry / new_terminal_window.rb
Last active December 14, 2015 11:39
A simple ruby script to create a new terminal window in the current directory.
#!/usr/bin/env ruby
exec "osascript -e 'tell application \"terminal\"' -e \"do script \\\"cd #{Dir.pwd}\\\"\" -e 'end tell'"
@DavidBarry
DavidBarry / switchem.rb
Last active December 16, 2015 22:59
A ruby script that turns an enum definition into a switch statement.
#!/usr/bin/env ruby
require 'optparse'
enum_string = ""
statements = "<#statements#>"
switch_expression = "<#expression#>"
tab_width = 4
use_tabs = false;
OptionParser.new do |option|
//
// UILabel+LegitShadowOffset.h
//
// Created by David Barry on 5/29/13.
// Copyright (c) 2013 David Barry. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UILabel (LegitShadowOffset)

Keybase proof

I hereby claim:

  • I am davidbarry on github.
  • I am davidbarry (https://keybase.io/davidbarry) on keybase.
  • I have a public key whose fingerprint is EEC9 B2DA BAA6 3830 7199 CE03 685D 165D 0D0F B29F

To claim this, I am signing this object: