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
*.xcuserdatad/ | |
docset-installed.txt | |
# OS X Finder | |
.DS_Store | |
# Xcode per-user config | |
*.mode1 | |
*.mode1v3 | |
*.mode2v3 |
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
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
/// | |
/// Localizable.strings.m | |
/// Checkmate | |
/// | |
/// The following macro displays a message at the top of the Localizable.strings file warning anyone to not edit the file directly. | |
/// This is not meant to be localized by anyone and only serves as a warning. | |
/// We've placed this here so the genstrings build phase will process it and add it to Localizable.strings | |
/// | |
/// Copyright (c) 2011 Micromat, Inc. All rights reserved. |
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
################################################## | |
## Attribute for diff'ing UTF-8 .strings files | |
*.strings -crlf set diff | |
################################################## | |
## Attribute to for easy merging of Xcode project files | |
*.pbxproj merge=union |
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 | |
DumpQuarantineEventsURLs() | |
{ | |
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent' | awk '/.+/ {print}' | sort | |
} | |
DumpQuarantineEvents() | |
{ |
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 | |
LSREGISTER="/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister" | |
echo "Rebuilding LaunchServices database..." | |
"${LSREGISTER}" -kill -r -all system,local,user | |
echo "Done." |
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> | |
#import <utmpx.h> | |
// CCFLAGS="-std=c99 -framework Foundation -arch i386 -mmacosx-version-min=10.6" | |
NSSet *ConsoleUsers(void) | |
{ | |
NSMutableSet *userList = [NSMutableSet set]; | |
struct utmpx *userTmp = getutxent(); |
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 <execinfo.h> | |
#import <stdio.h> | |
void PrintStackTrace(void) | |
{ | |
void* callstack[128]; | |
int i, frames = backtrace(callstack, 128); | |
char** strs = backtrace_symbols(callstack, frames); | |
for (i = 0; i < frames; ++i) { | |
printf("%s\n", strs[i]); | |
} |
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
#define $(...) ((NSString *)[NSString stringWithFormat:__VA_ARGS__,nil]) | |
// use like so...[$(@"whatever%ld %@", 2, obj ) stringByRemoving...... |
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
/* This returns the full process name, rather than the 16 char limit | |
the p_comm field of the proc struct is limited to. | |
Note that this only works if the process is running under the same | |
user you are, or you are running this code as root. If not, then | |
the p_comm field is used (this function returns nil). | |
*/ | |
NSString *GetNameForProcessWithPID(pid_t pidNum) | |
{ | |
NSString *returnString = nil; |
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
struct { | |
int (*AND_function_ptr)(int, int); | |
int (*math_funct_ptr)(float, char, float); | |
int (*comp_funct_ptr)(double); | |
int (*regul_funct_ptr)(char*, char*, int); | |
}functions; | |
int AND_function (int parameter1, int parameter2) | |
{ | |
} |