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/sh | |
homeDir=$1 | |
#cd /Users/ranwenjie/Desktop/c:c++/Bitcoin-xcode/bitcoin/src | |
cd $homeDir | |
# 目录内的源码统计 | |
echo "" > /tmp/1.txt | |
find . -maxdepth 1 -type d -print0 | while read -d '' -r dir; do | |
files=("$dir"/*) |
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
/* Allow Landscape mode for specific ViewControllers */ | |
-(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { | |
UIViewController* topVC = [self topViewControllerWith: self.window.rootViewController]; | |
if ([topVC respondsToSelector:@selector(canRotate)]) { | |
return UIInterfaceOrientationMaskAllButUpsideDown; | |
} | |
return UIInterfaceOrientationMaskPortrait; | |
} | |
/* get the top ViewController */ |
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
// | |
// UIAlertViewCrashFix.h | |
// | |
// Created by Josh Hudnall on 4/28/15. | |
// | |
// | |
#import <Foundation/Foundation.h> | |
@interface UIAlertController (CrashFix) |
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)umengTrack { | |
NSString *channelId; | |
if ([MobClick isJailbroken]) { | |
if ([MobClick isPirated]) { | |
// 已破解(越狱) | |
channelId = @"盗版市场(越狱)"; | |
}else{ | |
// 未破解(越狱) |
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 | |
######################### | |
# usage: iosicon.sh 1024-icon.png | |
######################### | |
function print_usage(){ | |
echo "################################" |
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
#import <mach/mach.h> | |
// http://stackoverflow.com/questions/8223348/ios-get-cpu-usage-from-application | |
float cpu_usage() | |
{ | |
kern_return_t kr; | |
task_info_data_t tinfo; | |
mach_msg_type_number_t task_info_count; | |
task_info_count = TASK_INFO_MAX; | |
kr = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)tinfo, &task_info_count); |
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
#import <mach/mach.h> | |
// http://stackoverflow.com/questions/8223348/ios-get-cpu-usage-from-application | |
float cpu_usage() | |
{ | |
kern_return_t kr; | |
task_info_data_t tinfo; | |
mach_msg_type_number_t task_info_count; | |
task_info_count = TASK_INFO_MAX; | |
kr = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)tinfo, &task_info_count); |
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
#import <mach/mach.h> | |
float cpu_usage() | |
{ | |
kern_return_t kr; | |
task_info_data_t tinfo; | |
mach_msg_type_number_t task_info_count; | |
task_info_count = TASK_INFO_MAX; | |
kr = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)tinfo, &task_info_count); |
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
#!/usr/sbin/dtrace -s | |
/* Run like: | |
% sudo csh | |
# ./spy.d $PROCESS_ID [$INTERESTING_PROBEPROV] | |
Prints a line of dashes every 5 seconds to delineate different experiments. | |
*/ | |
#pragma D option quiet |
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
// rate | |
[Appirater setAppId:kAppStoreID]; | |
[Appirater setOpenInAppStore:YES]; // 设置为NO,in-app方式打开 | |
[Appirater setDaysUntilPrompt:1]; // 1天过后 | |
[Appirater setUsesUntilPrompt:10]; // 使用10次 | |
[Appirater setSignificantEventsUntilPrompt:-1]; | |
[Appirater setTimeBeforeReminding:2]; | |
[Appirater appLaunched:YES]; |
NewerOlder