This file contains hidden or 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
tell application "Address Book" | |
set prefix to "+65" | |
repeat with p in (get people) | |
repeat with n in (get p's phones) | |
set num to ReplaceText(n's value, " ", "") of me | |
if (count num) is 8 then | |
set n's value to prefix & num | |
end if |
This file contains hidden or 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
tell application "Address Book" | |
set prefix to ", " | |
repeat with p in (get people) | |
set gs to "" | |
repeat with g in (get p's groups) | |
if (gs = "") then | |
set gs to g's name |
This file contains hidden or 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
-- Useful if you want to implement keyboard shortcuts with apps like Alfred App | |
-- Recreate this by changing the + to - for the volume down script | |
set curVol to (get (output volume of (get volume settings))) | |
set volume output volume (curVol + 5) | |
do shell script "afplay /System/Library/LoginPlugins/BezelServices.loginPlugin/Contents/Resources/volume.aiff" |
This file contains hidden or 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
if (([MNAttributedString lossless]) && ([[attrs objectForKey:key] conformsToProtocol:@protocol(NSCoding)])) { | |
[attributes insertObject:[self _dictionaryForAttributes:[NSDictionary dictionaryWithObject:[attrs objectForKey:key] forKey:key] range:range] atIndex:([attributes count]-1)]; | |
} |
This file contains hidden or 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
// | |
// LBCStreamWriter.h | |
// LBCCore | |
// | |
// Created by Jeremy Foo on 23/5/12. | |
// Copyright (c) 2012 BOB FTW PTE LTD. All rights reserved. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of | |
// this software and associated documentation files (the "Software"), to deal in | |
// the Software without restriction, including without limitation the rights to |
This file contains hidden or 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
Analyze "Classes/FacadeQueue/Network Manager/LBCNetworkManager.m" | |
cd /Users/jeremy/Desktop/LBCManagers | |
setenv LANG en_US.US-ASCII | |
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" | |
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -std=gnu99 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG |
This file contains hidden or 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
// | |
// LBCHTTPPostBody.h | |
// LBCCore | |
// | |
// Created by Jeremy Foo on 22/5/12. | |
// Copyright (c) 2012 BOB FTW PTE LTD. All rights reserved. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of | |
// this software and associated documentation files (the "Software"), to deal in | |
// the Software without restriction, including without limitation the rights to |
This file contains hidden or 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
// _requests is a dictionary that can be mutated on any thread | |
// __tokenLBCURLRequestMap is just a dictionary to check if the token already is being "processed" | |
-(NSString *)readyToken { | |
if ([_requests count] == 0) | |
return nil; | |
NSMutableArray *tokens = [[[_requests allKeys] mutableCopy] autorelease]; | |
NSString *token = nil; |
This file contains hidden or 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
// Consider an accessor setter method | |
-(void)setUniqueIDString:(NSString *)uid { | |
if (uid != _uid) { | |
[_uid release]; | |
_uid = [uid copy]; | |
} | |
} | |
// You can do [object setUniqueIDString:nil] and not crash. |
This file contains hidden or 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)doAnimated:(BOOL)animated animation:(void (^)(void))animation { | |
if (animated) { | |
[UIView animateWithDuration:0.33 | |
delay:0.0 | |
options:(UIViewAnimationCurveEaseInOut | UIViewAnimationOptionBeginFromCurrentState) | |
animations:animation | |
completion:nil]; | |
} else { | |
animation(); | |
} |
OlderNewer