Skip to content

Instantly share code, notes, and snippets.

@naiveal
naiveal / gist:3238401
Created August 2, 2012 16:28
Doxygen formmater
#!/usr/bin/env ruby
#
# This script helps you make doxygen comments in Obj-C/C/C++ files in XCode
#
# Created by Fred McCann on 03/16/2010 - and Edwin.
# Adapted for ThisService by Martin Pichlmair 03/29/2011
# http://www.duckrowing.com
#
@naiveal
naiveal / ALBUpdateBundleVersion.py
Created August 2, 2012 08:48 — forked from collindonnell/ALBUpdateBundleVersion.py
Automated Xcode build script to update CFBundleVersion, commit and tag with Git.
#!/usr/bin python
from AppKit import NSMutableDictionary
import os
# Get the name of the current configuration.
configuration = os.environ['CONFIGURATION']
# List of valid configurations where this script should run.
configurations_list = ['Beta', 'App Store']
@naiveal
naiveal / Xcode4TestFlightintegration.sh
Created August 2, 2012 08:44 — forked from incanus/Xcode4TestFlightintegration.sh
Xcode 4 scheme Archive step Post-script for automatic TestFlight build uploading. See the blog post here: http://developmentseed.org/blog/2011/sep/02/automating-development-uploads-testflight-xcode
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
API_TOKEN=<TestFlight API token here>
TEAM_TOKEN=<TestFlight team token here>
SIGNING_IDENTITY="iPhone Distribution: Development Seed"
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/MapBox Ad Hoc.mobileprovision"
#LOG="/tmp/testflight.log"
@naiveal
naiveal / gist:3235420
Created August 2, 2012 08:27
Build Version Auto increase
#!/bin/bash
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber""$INFOPLIST_FILE"
@naiveal
naiveal / gist:3187150
Created July 27, 2012 09:48
printfTreeLevelOfView
void printfTreeLevelOfView(UIView *view, int maxLevel)
{
UIView *tempView;
NSArray *subViews = [view subviews];
static int level = 0;
level++;
for(tempView in subViews)
{
if ( level <= maxLevel) {
for (int i = 0; i < level; i++)
@naiveal
naiveal / gist:3185219
Created July 26, 2012 23:26
Push Controller with transition
- (void) pushController: (UIViewController*) controller
withTransition: (UIViewAnimationTransition) transition
{
[UIView beginAnimations:nil context:NULL];
[self pushViewController:controller animated:NO];
[UIView setAnimationDuration:.5];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationTransition:transition forView:self.view cache:YES];
[UIView commitAnimations];
@naiveal
naiveal / md5.m
Created July 17, 2012 06:48
MD5 crypto
#import <CommonCrypto/CommonDigest.h> // Need to import for CC_MD5 access
- (NSString *)md5:(NSString *)str
{
const char *cStr = [str UTF8String];
unsigned char result[16];
CC_MD5(cStr, strlen(cStr), result); // This is the md5 call
return [NSString stringWithFormat:
@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
result[0], result[1], result[2], result[3],
result[4], result[5], result[6], result[7],