This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* CLAlert is a drop-in replacement for NSAlert | |
* | |
* A CLAlert is exactly the same as a NSAlert, except for the alert style behavior | |
* | |
* - An alert with the informational style (NSInformationalAlertStyle) will always display a "Note icon" (kAlertNoteIcon) | |
* - An alert with the warning style (NSWarningAlertStyle) will always display a "Caution icon" (kAlertCautionIcon) | |
* - An alert with the critical style (NSCriticalAlertStyle) will always display a "Stop icon" (kAlertStopIcon) | |
* | |
* Tested on Mac OS X 10.5.8 and 10.6.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ========================= | |
// SetInterval | |
// ========================= | |
// While not truly accurate, setInterval is still fairly good, time-wise. | |
// Better for things like a "one second tick" but not great for expensive | |
// code executed at small intervals as iterations can "stack". | |
// (ECMAScript 5 strict mode compatible) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// UIColor+hex.h | |
@interface UIColor (Hex) | |
+ (UIColor *) colorWithHex:(uint)rgbValue; | |
@end | |
// UIColor+hex.m | |
#import "UIColor+Hex.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UIImage (Shadow) | |
+ (UIImage *)imageWithContentsOfFile:(NSString *)path withShadow:(BOOL)applyShadow; | |
+ (UIImage *)imageNamed:(NSString *)name withShadow:(BOOL)applyShadow; | |
+ (UIImage *)applyShadow:(UIImage *)theImage; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# uncrustify config file for objective-c and objective-c++ | |
# | |
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs | |
output_tab_size = 4 # new tab size | |
indent_columns = output_tab_size | |
indent_label = 2 # pos: absolute col, neg: relative column | |
indent_align_assign = FALSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef DEBUG | |
// Debug log | |
#define DLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]) | |
// Assert log | |
#define ASLog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__] | |
#else | |
#define DLog(...) do { } while (0) | |
#ifndef NS_BLOCK_ASSERTIONS | |
#define NS_BLOCK_ASSERTIONS | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, subprocess, re, sys | |
appname = "yourappname" | |
hgbin = "/usr/local/bin/hg" | |
targetBuildDir = os.getenv("TARGET_BUILD_DIR") | |
getChangeset = subprocess.Popen(hgbin + ' parent --template "{node|short}" --cwd ' + targetBuildDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) | |
if (getChangeset.stderr.read() != ""): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
startup_message off | |
shell -${SHELL} | |
caption always "%n(%t) : %C" | |
defscrollback 1024 | |
startup_message off | |
hardstatus on | |
hardstatus alwayslastline | |
setenv LC_CTYPE en_US.UTF-8 | |
defutf8 on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install node wherever... | |
cat <<NPMRC >>$HOME/.npmrc | |
root = ~/.node_libraries | |
manroot = ~/local/share/man | |
binroot = ~/bin | |
NPMRC | |
curl http://npmjs.org/install.sh | sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Load RVM, if you are using it | |
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm | |
# Add rvm gems and nginx to the path | |
export PATH=$PATH:~/.gem/ruby/1.8/bin:/opt/nginx/sbin:~/bin:/opt/local/bin:/opt/local/sbin | |
# Path to the bash it configuration | |
export BASH=$HOME/.bash_it |
OlderNewer