Skip to content

Instantly share code, notes, and snippets.

@kompozer
kompozer / CLAlert.h
Created January 17, 2010 23:01 — forked from 0xced/CLAlert.h
/*
* 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
// =========================
// 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)
// UIColor+hex.h
@interface UIColor (Hex)
+ (UIColor *) colorWithHex:(uint)rgbValue;
@end
// UIColor+hex.m
#import "UIColor+Hex.h"
@interface UIImage (Shadow)
+ (UIImage *)imageWithContentsOfFile:(NSString *)path withShadow:(BOOL)applyShadow;
+ (UIImage *)imageNamed:(NSString *)name withShadow:(BOOL)applyShadow;
+ (UIImage *)applyShadow:(UIImage *)theImage;
@end
#
# 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
#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
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() != ""):
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
# install node wherever...
cat <<NPMRC >>$HOME/.npmrc
root = ~/.node_libraries
manroot = ~/local/share/man
binroot = ~/bin
NPMRC
curl http://npmjs.org/install.sh | sh
@kompozer
kompozer / .bash_profile
Created December 7, 2010 11:23
the bash_profile file for bash-it
#!/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