Skip to content

Instantly share code, notes, and snippets.

show_icons() {
defaults write com.apple.finder CreateDesktop true
killall Finder
}
hide_icons() {
defaults write com.apple.finder CreateDesktop false
killall Finder
}

Keybase proof

I hereby claim:

  • I am daveanderson on github.
  • I am daveanderson (https://keybase.io/daveanderson) on keybase.
  • I have a public key whose fingerprint is 3CAE 7754 6936 7414 31CF 26E6 3E51 C91F 415B 2EB2

To claim this, I am signing this object:

@daveanderson
daveanderson / enterprise.html
Created May 9, 2013 19:18
Direct URL enterprise distribution
<html>
<head>
<meta http-equiv="Refresh" content="0; url=itms-services://?action=download-manifest&url=http://bucket.s3.amazonaws.com/AppName.plist" />
</head>
<a href="itms-services://?action=download-manifest&url=http://bucket.s3.amazonaws.com/AppName.plist">Install AppName</a>
</html>
@daveanderson
daveanderson / gist:4152460
Created November 27, 2012 04:54
Autolayout Debugging
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x12ce5af0 V:[UIView:0x12cdeb00(>=8)]>",
"<NSLayoutConstraint:0x12ce58f0 V:[UITextView:0x139b9000(>=80)]>",
"<NSLayoutConstraint:0x12ce56b0 V:[WJFormLabel:0x12cd0070]-(0)-[UITextView:0x139bbe00]>",
"<NSLayoutConstraint:0x12ce5670 V:[WJFormLabel:0x12cd0070(>=40)]>",
"<NSLayoutConstraint:0x12ce5480 V:[WJFormLabel:0x12cd4ec0(>=40)]>",
"<NSLayoutConstraint:0x12ce5630 V:[UIView:0x12ccff50]-(0)-[WJFormLabel:0x12cd0070]>",
"<NSLayoutConstraint:0x12ce5770 V:[UIView:0x12cd4da0(>=8)]>",
"<NSLayoutConstraint:0x12ce55b0 V:[UITextView:0x139bb2
@daveanderson
daveanderson / webViewManipulation
Created May 8, 2012 21:45
some crazy web view manipulation
+ (void)presentCustomizedCalgaryParkingSiteFromViewController:(UIViewController *)viewController {
NSString *registerURL = @"https://www.calgaryparking.com/web/guest/cpa_secure/parkplus?p_p_id=2&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&p_p_col_id=column-3&p_p_col_count=3&_2_struts_action=%2Fmy_account%2Fcreate_account";
WebViewController *webViewController = [[WebViewController alloc] initWithURLString:registerURL];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:webViewController];
NSString *registerRecognitionSnippet = @"_2_struts_action=%2Fmy_account%2Fcreate_account";
@daveanderson
daveanderson / beekeeper.md
Created March 14, 2012 20:51
Lesson 99: Beekeeper or Bee-Haver?

Lesson 99 – Beekeeper or Bee-haver

A BEE-HAVER is someone who can say they “HAVE” bees but they do not want beekeeping to consume their time or interest, so they spend little to no time keeping bees, they simply have bees. That’s certainly one approach.

Then there are those who want to evolve from just having bees to truly doing all they can to make sure their bees are as healthy as possible.

Beekeeper

Objective-C and Cocoa Conventions

AKA "Stop making your keyboard cry!"