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
#!/bin/bash | |
# Need Install NOMAD: gem install nomad-cli | |
# More About NOMAD http://nomad-cli.com | |
####### Configuration | |
# Directory Config | |
SOURCE_NAME="xxx" # Project Bundle name, commonly Project Name | |
TARGET_DIRECTORY="./xxx" # Target ipa and dSYM file Directoy | |
TARGET_NAME_PREFIX="xxx" # Target ipa and dSYM file 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
#!/bin/bash | |
# This script automatically sets the version and short version string of | |
# an Xcode project from the Git repository containing the project. | |
# | |
# To use this script in Xcode 4, add the contents to a "Run Script" build | |
# phase for your application target. | |
set -o errexit | |
set -o nounset |
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
call pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
set number | |
set hlsearch | |
highlight TabLine term=underline cterm=bold ctermfg=9 ctermbg=4 | |
highlight TabLineSel term=bold cterm=bold ctermbg=Red ctermfg=yellow | |
:color blackboard |
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
• tab - open the current directory in a new tab | |
• pfd - return the path of the frontmost Finder window | |
• pfs - return the current Finder selection | |
• cdf - cd to the current Finder directory | |
• pushdf - pushd to the current Finder directory | |
• quick-look - Quick Look a specified file | |
• man-preview - open a specified man page in Preview | |
• trash - move a specified file to the Trash |
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
@interface UIDevice (Helper) | |
- (BOOL)isJailbroken; | |
@end | |
@implementation UIDevice (Helper) | |
- (BOOL)isJailbroken { | |
BOOL jailbroken = NO; | |
NSString *cydiaPath = @"/Applications/Cydia.app"; | |
NSString *aptPath = @"/private/var/lib/apt/"; | |
if ([[NSFileManager defaultManager] fileExistsAtPath:cydiaPath]) { |
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)getExternalIP{ | |
NSURLRequest *ipRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://checkip.dyndns.com"]]; | |
NSURLResponse *ipResponse = nil; | |
NSError *ipError = nil; | |
NSData *ipData = [NSURLConnection sendSynchronousRequest:ipRequest | |
returningResponse:&ipResponse | |
error:&ipError]; | |
NSString *ipInfo = [[[NSString alloc] initWithData:ipData encoding:NSUTF8StringEncoding] autorelease]; | |
NSLog(@"ipInfo %@", ipInfo); | |
} |
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
+ (NSString *) getDNSServers | |
{ | |
NSMutableString *addresses = [[NSMutableString alloc]initWithString:@"DNS Addresses \n"]; | |
res_state res = malloc(sizeof(struct __res_state)); | |
int result = res_ninit(res); | |
if ( result == 0 ) | |
{ |
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
+ (NSArray *)localIPAddresses | |
{ | |
NSMutableArray *ipAddresses = [NSMutableArray array] ; | |
struct ifaddrs *allInterfaces; | |
// Get list of all interfaces on the local machine: | |
if (getifaddrs(&allInterfaces) == 0) { | |
struct ifaddrs *interface; | |
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
+ (NSString *)macAddress{ | |
int mib[6]; | |
size_t len; | |
char *buf; | |
unsigned char *ptr; | |
struct if_msghdr *ifm; | |
struct sockaddr_dl *sdl; | |
mib[0] = CTL_NET; | |
mib[1] = AF_ROUTE; |