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
#sudo apt-get remove maven2 | |
sudo add-apt-repository "deb http://ppa.launchpad.net/natecarlson/maven3/ubuntu precise main" | |
sudo apt-get update | |
sudo apt-get install maven3 | |
#If you encounter this: | |
#The program 'mvn' can be found in the following packages: | |
# * maven | |
# * maven2 |
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
{ | |
"request_id": "2220913894196", | |
"errno": 0, | |
"error": "", | |
"data": { | |
"info": [ | |
{ | |
"city_id": 110000, | |
"city_name": "北京", | |
"subway_line": [ |
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
expression = @"^((13[0-9])|(14[57])|(15[^4,\\D])|(17[678])|(18[0-9]))\\d{8}$"; |
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
- (UIImageView *)findHairlineImageViewUnder:(UIView *)view { | |
if ([view isKindOfClass:UIImageView.class] && view.bounds.size.height <= 1.0) { | |
return (UIImageView *)view; | |
} | |
for (UIView *subview in view.subviews) { | |
UIImageView *imageView = [self findHairlineImageViewUnder:subview]; | |
if (imageView) { | |
return imageView; | |
} | |
} |
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
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; | |
NSSortDescriptor *descriptor1 = [[NSSortDescriptor alloc] initWithKey:@"endCalYear" ascending:YES]; | |
NSSortDescriptor *descriptor2 = [[NSSortDescriptor alloc] initWithKey:@"endMonth" ascending:YES]; | |
NSSortDescriptor *descriptor3 = [[NSSortDescriptor alloc] initWithKey:@"periodLength" ascending:YES]; | |
NSArray *sortDescriptors = @[descriptor1, descriptor2, descriptor3]; | |
[fetchRequest setSortDescriptors:sortDescriptors]; |
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
if ([[AVAudioSession sharedInstance] respondsToSelector:@selector(requestRecordPermission:)]) { | |
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) { | |
if (!granted) { | |
//检测到不可用 | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
//回到主线程做出相应提示 | |
}); | |
} | |
}]; | |
} |
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
// Photoshop Script to Create iPhone Icons from iTunesArtwork | |
// | |
// WARNING!!! In the rare case that there are name collisions, this script will | |
// overwrite (delete perminently) files in the same folder in which the selected | |
// iTunesArtwork file is located. Therefore, to be safe, before running the | |
// script, it's best to make sure the selected iTuensArtwork file is the only | |
// file in its containing folder. | |
// | |
// Copyright (c) 2010 Matt Di Pasquale | |
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com |
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*)toImage | |
{ | |
UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, 0.0); | |
[self.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return img; | |
} |
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
<?php | |
/** | |
* img.ly class for Kohana v3.0.x | |
* | |
* @author icyleaf <[email protected]> | |
* @link http://icyleaf.com | |
* @version 0.1 | |
* @license http://www.opensource.org/licenses/bsd-license.php | |
*/ | |
class imgly { |
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
#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES) |
NewerOlder