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
#if defined(DEBUG) | |
#define HTLog(__VA_ARGS__) NSLog(__VA_ARGS__) | |
#define HTLog2(fmt, ...) NSLog((fmt), ##__VAR_ARGS__) | |
#else | |
#define HTLog(__VA_ARGS__) while (FALSE) { } | |
#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 <Foundation/Foundation.h> | |
@interface HTWait : NSObject | |
{ | |
BOOL signaled; | |
} | |
- (void)prepare; | |
- (void)signal; | |
- (void)waitForTimeout:(NSTimeInterval)timeOut; |
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
" line number and length | |
set number | |
" set tw=79 " Width of document | |
set nowrap | |
set fo-=t " dont' automaticall wrap text when typing | |
set colorcolumn=80 | |
highlight ColorColumn ctermbg=233 | |
set ruler | |
" syntax highlight |
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
#!/usr/bin/env bash | |
P4MERGE=/Applications/p4merge.app/Contents/MacOS/p4merge | |
[ $# -eq 7 ] && ${P4MERGE} "$2" "$5" |
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
pmset sleepnow |
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 static void exportToPhoto(File src) { | |
String srcFilePath = src.getAbsolutePath(); | |
String targetFileName = srcFilePath.substring(srcFilePath.lastIndexOf('/') + 1); | |
try { | |
File outputFile = new File(getPublicExternalPicturePath(), targetFileName); | |
copyFile(src, outputFile); | |
MediaScannerConnection.scanFile(mActivity, | |
new String[] {outputfile.toString() }, null, | |
new MediaScannerConnection.OnScanCompletedListener() { |
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 static void copyFile(File src, File target) throws FileNotFoundException, IOException { | |
FileInputStream inStream = new FileInputStream(src); | |
FileOutputStream outStream = new FileOutputStream(target); | |
FileChannel inChannel = inStream.getChannel(); | |
FileChannel outChannel = outStream.getChannel(); | |
inChannel.transferTo(0, inChannel.size(), outChannel); | |
inStream.close(); | |
outStream.close(); | |
} |
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
#!/usr/bin/env bash | |
git rev-parse --abbrev-ref HEAD | |
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
#!/usr/bin/env bash | |
/Applications/p4merge.app/Contents/MacOS/p4merge $* |
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
export LS_COLORS="di=00;34:ln=00;35:so=00;32:pi=01;33:ex=00;31:bd=00;34" |
OlderNewer