Skip to content

Instantly share code, notes, and snippets.

@jamztang
jamztang / rsync_xcode_clean
Created September 2, 2011 08:11
Using rsync to extract code out of .git
rsync_xcode_clean () { rsync -av $1 --exclude "DerivedData" --exclude "build" --exclude ".git" $2; }
@jamztang
jamztang / README.md
Created September 2, 2011 08:25
Adding fadeout effect to any -[UIViews removeFromSuperview]

Sometimes it’s not that please for a user to see an UI component disappearing suddenly. You’d then consider adding some transition effects, and here’s a little code snippet in the UIView+JTRemoveAnimated category for how you can get a fade out effect on view removal.

So from now on, you just needed to do this to fade out any UIViews

[myView removeFromSuperviewAnimated]

@jamztang
jamztang / symbolizecrashlog
Created September 15, 2011 12:22
symbolizecrashlog fixed script for iOS apps. (Fixed regex for both .crash and copy/pasted crash logs)
#!/bin/bash
AWK_SCRIPT=/tmp/symbolizecrashlog_$$.awk
SH_SCRIPT=/tmp/symbolizecrashlog_$$.sh
if [[ $# < 2 ]]
then
echo "Usage: $0 [ -arch <arch> ] symbol-file [ crash.log, ... ]"
exit 1
fi
@jamztang
jamztang / makeIpaFromApp
Created September 15, 2011 12:26
Script that archive an .app to .ipa for iOS developement builds - makeIpaFromApp
#!/bin/bash
#init
#function pause() {
#read -p "$*"
#}
payloadDIR="Payload"
#if [ -d $payloadDIR ]
@jamztang
jamztang / .gitignore
Created September 16, 2011 11:31
.gitignore template for iOS projects
.DS_Store
.svn
build
DerivedData
*.xcodeproj/*.mode1v3
*.xcodeproj/*.pbxuser
*.xcodeproj/project.xcworkspace/*
*.xcodeproj/xcuserdata/*
@jamztang
jamztang / UIImage+JTImageDecode.h
Created October 2, 2011 05:40
Force UIImage to decompress
//
// UIImage+JTImageDecode.h
//
// Created by james on 9/28/11.
// http://ioscodesnippet.tumblr.com
//
@interface UIImage (JTImageDecode)
+ (UIImage *)decodedImageWithImage:(UIImage *)image;
@end
@jamztang
jamztang / JTInvocationManager.h
Created October 2, 2011 17:37
Easily perform list of operations on specific NSOperationQueue through NSProxy
//
// JTInvocationManager.h
//
// Created by James Tang on 02/10/2011.
//
#import <Foundation/Foundation.h>
@interface JTInvocationManager : NSProxy {
id _proxiedTarget;
@jamztang
jamztang / JTMainQueueProxy.h
Created October 2, 2011 17:37
Using NSProxy to perform operation on main thread easily
//
// JTMainQueueProxy.h
//
// Created by James Tang on 02/10/2011.
//
#import <Foundation/Foundation.h>
@interface JTMainQueueProxy : NSProxy {
id _proxiedTarget;
@jamztang
jamztang / .screenrc
Created October 2, 2011 17:47
.screenrc
shell -${SHELL}
caption always "%n(%t) : %C"
startup_message off
hardstatus on
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'
defscrollback 5000
bind b eval "writebuf" "exec sh -c 'pbcopy < /tmp/screen-exchange'"
@jamztang
jamztang / .vimrc
Created October 2, 2011 17:48
.vimrc
" File: _vimrc
" Version: 1
" Author: Seth Mason
" Created: 19 Nov 2003 10:20:19
" Last-modified: 18 May 2010 10:54:38
" All my Vim commands for the taking
" Works on cygwin but not very well on unix machines...still trying to figure
" it out