Skip to content

Instantly share code, notes, and snippets.

sudo puppet agent --environment=KillXcodeBeforeCheckout --debug --test
cat /etc/puppetlabs/puppet/puppet.conf
@xianwen
xianwen / KeychainWrapper.h
Created September 6, 2013 03:34
KeychainWrapper Class for security
#import <Foundation/Foundation.h>
#import <Security/Security.h>
#import <CommonCrypto/CommonHMAC.h>
@interface KeychainWrapper : NSObject
// Generic exposed method to search the keychain for a given value. Limit one result per search.
+ (NSData *)searchKeychainCopyMatchingIdentifier:(NSString *)identifier;
// Calls searchKeychainCopyMatchingIdentifier: and converts to a string value.
@xianwen
xianwen / DisableDashboardInMacOSX.sh
Created May 13, 2013 13:45
Disable dashboard in MacOSX
defaults write com.apple.dashboard mcx-disabled -boolean YES
killall Dock
@xianwen
xianwen / SetBackgroundImageForTableView.m
Created May 13, 2013 13:37
Set background image for table view
UIImageView *tempImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"store-bg"]];
[tempImageView setFrame:self.tableView.frame];
self.tableView.backgroundView = tempImageView;
@xianwen
xianwen / UpdateNavigationBarBackground.m
Created May 13, 2013 13:35
Update background image for all UINavigationBars
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Customize appearance
[self customizeAppearance];
...
}
- (void)customizeAppearance
{
// Set the background image for all UINavigationBars