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
# ~/.lldbinit | |
... | |
command script import /usr/local/bin/fblldb.py | |
command alias reveal_load_sim expr (void*)dlopen("/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2); | |
command alias reveal_load_dev expr (void*)dlopen([(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@"libReveal" ofType:@"dylib"] cStringUsingEncoding:0x4], 0x2); | |
command alias reveal_start expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil]; | |
command alias reveal_stop expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStop" object: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
# xcode-build-bump.sh | |
# @desc Auto-increment the build number every time the project is run. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |
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
/** | |
* Several macros simplifying use of weak references to self inside blocks | |
* which goal is to reduce risk of retain cycles. | |
* | |
* Example: | |
* @code | |
@interface Example : NSObject{ | |
int _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
#!/bin/sh | |
# BuildDmg.sh | |
# Build OS X .dmg install file | |
# Author maojiajun | |
set -eu | |
################################################################################### | |
# config, change for you app. |
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 | |
# | |
# BurnUSBInstall.sh | |
# | |
# This is the script for burning a Mac OS X bootable USB drive. | |
# | |
# Author: maojj | |
# 2014.07.10 | |
# | |
# Prepare an 8GB+ USB stick and format it with GUID partition mapping and a partition named Untitled |
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 | |
# | |
# This is an autosync script for bypy(Baidu Yun) on WD My Book Live | |
# I use it in crontab(erery hour): 0 * * * * /path/to_this_script/autosync.sh | |
# a sync my cost more than an hour, | |
# so use flag file to make sure only one autosync.sh is running.(dirty way) | |
# | |
# About bypy: Python client for Baidu Yun (Personal Cloud Storage) | |
# see: https://github.com/houtianze/bypy | |
# |
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 <QuartzCore/QuartzCore.h> | |
#import <UIKit/UIKit.h> | |
@interface CALayer(XibConfiguration) | |
// This assigns a CGColor to borderColor. | |
@property(nonatomic, assign) UIColor* borderUIColor; | |
@end |
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
// | |
// UIView+Utils.h | |
// Borrowed from Three20 / DTFoundation | |
// | |
// Copyright (c) 2013 iOS. No rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
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
-(uint64_t)getFreeDiskSpace { | |
uint64_t totalSpace = 0; | |
uint64_t totalFreeSpace = 0; | |
NSError *error = nil; | |
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error: &error]; | |
if (dictionary) { | |
NSNumber *fileSystemSizeInBytes = [dictionary objectForKey: NSFileSystemSize]; | |
NSNumber *freeFileSystemSizeInBytes = [dictionary objectForKey:NSFileSystemFreeSize]; |
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
# | |
# Uncrustify Configuration File | |
# File Created With UncrustifyX 0.2 (140) | |
# | |
# Alignment | |
# --------- | |
## Alignment |