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 | |
# BuildDmg.sh | |
# Build OS X .dmg install file | |
# Author maojiajun | |
set -eu | |
################################################################################### | |
# config, change for you app. |
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
/** | |
* 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 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
# 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 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
# ~/.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 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 *path = [NSHomeDirectory() stringByAppendingPathComponent: | |
@"../../Library/Preferences/com.apple.Preferences.plist"]; | |
NSMutableDictionary *dict = | |
[NSMutableDictionary dictionaryWithContentsOfFile:path]; | |
[dict setObject:[NSNumber numberWithBool:YES] forKey:@"KeyboardEmojiEverywhere"]; | |
[dict writeToFile:path atomically:NO]; |
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 <Foundation/Foundation.h> | |
@interface NSString (JSON) | |
- (id) JSONValue; | |
@end | |
@implementation NSString (JSON) | |
- (id) JSONValue { | |
NSError *error = nil; | |
id obj = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:&error]; |
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
# 1.install gource using HomeBrew | |
$ brew install gource | |
# 2.install avconv | |
git clone git://git.libav.org/libav.git | |
cd libav | |
# it will take 3-5 minutes to complie, be patient. | |
./configure --disable-yasm | |
make && make install |
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
-(UIImage*)getGrayImage:(UIImage*)sourceImage | |
{ | |
int width = sourceImage.size.width; | |
int height = sourceImage.size.height; | |
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray(); | |
CGContextRef context = CGBitmapContextCreate (nil,width,height,8,0,colorSpace,kCGImageAlphaNone); | |
CGColorSpaceRelease(colorSpace); | |
if (context == NULL) { |
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
APP = LL | |
WORKSPACE = LL | |
CONFIG = AdHoc | |
SCHEME = LLAdHoc | |
ICON_NAME = "[email protected]" | |
BASE_URL = http://ota.nsnotfound.com/ | |
EMAIL_LIST = "[email protected]" | |
EMAIL_DOMAIN = "lexrus.mailgun.org" | |
SFTP_SERVER = [email protected] |
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 | |
# File name : convertImage.sh | |
# Author: Mao Jiajun | |
# | |
# print usage | |
usage() { | |
cat << EOF | |
Usage: | |
cropcorner.sh <> <src file> <geometry> <dest file> |