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
+(void)uploadUserPhoto:(UIImage *)image | |
success:(void (^)(void))success | |
failure:(FailureBlock)failure | |
{ | |
GTSessionManager * manager = [GTSessionManager manager]; | |
NSString* tmpFilename = [NSString stringWithFormat:@"%f", [NSDate timeIntervalSinceReferenceDate]]; | |
NSURL* tmpFileUrl = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:tmpFilename]]; | |
NSString * query = [NSString stringWithFormat:@"%@user?auth_token=%@",[manager.baseURL absoluteString],[[UserManager shared] authToken]]; |
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
- (void)cancel | |
{ | |
for(NSURLSessionTask *task in _tasks) { | |
[task cancel]; | |
} | |
} |
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
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev | |
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz --no-check-certificate | |
tar -xzf Python-2.7.3.tgz | |
cd Python-2.7.3 | |
./configure --prefix=/usr --enable-shared | |
make | |
sudo make install | |
cd .. |
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
#!/sbin/runscript | |
# This script assumes that Riemann has a user and group set up, and that the | |
# service files have been extracted to `/var/lib/riemann/current`. | |
# | |
# Author: Greg Look (greg@mvxcvi.com) | |
extra_started_commands="reload" | |
CFG_DIR=/etc/riemann |
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
FancyHotSpot *hotSpotA; | |
FancyHotSpot *hotSpotB; | |
// notifications from hotSpotA should call hotSpotATouched: | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(hotSpotATouched:) name:@"HotSpotTouched" | |
object:hotSpotA]; // only notifications from hotSpotA will be received | |
// notifications from hotSpotB should call hotSpotBTouched: | |
[[NSNotificationCenter defaultCenter] addObserver:self |
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
// NSString+Extension.h | |
@interface NSString (Extension) | |
+ (NSString *) getUUID; | |
+ (NSString *) sha1:(NSString *)input; | |
@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
+(NSString *) generateUUID | |
{ | |
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault); | |
CFStringRef uuidString = CFUUIDCreateString(kCFAllocatorDefault, uuid); | |
CFRelease(uuid); | |
NSString* newUuid = [(NSString *)uuidString copy]; | |
CFRelease(uuidString); | |
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
private CharSequence[] items = {"Set as Ringtone", "Set as Alarm"}; | |
AlertDialog.Builder builder = new AlertDialog.Builder(this); | |
builder.setItems(items, new DialogInterface.OnClickListener() { | |
public void onClick(DialogInterface dialog, int item) { | |
if(item == 0) { | |
} else if(item == 1) { | |
} else if(item == 2) { |
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
public int getStatusBarHeight() { | |
int statusBarHeight = 0; | |
if (!hasOnScreenSystemBar()) { | |
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); | |
if (resourceId > 0) { | |
statusBarHeight = getResources().getDimensionPixelSize(resourceId); | |
} | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Default Partition</key> | |
<string>hd(0,2)</string> | |
<key>EthernetBuiltIn</key> | |
<string>Yes</string> | |
<key>Graphics Mode</key> | |
<string>1024x768x32</string> |
OlderNewer