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 UIImage (fixOrientation) | |
| - (UIImage *)fixOrientation; | |
| @end |
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
| WITH x AS ( | |
| SELECT [TYPE_SID] | |
| ,[CATEGORY_SID] | |
| ,[APARTMENT_SID] | |
| ,[TYPE_NAME] | |
| ,[REMARK] | |
| ,[PARENT_SID] | |
| ,[CREATEDBY] | |
| ,[CREATED_ON] |
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
| UIBezierPath * bezierPath = [UIBezierPath bezierPathWithRoundedRect:topicView.bounds | |
| byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight | |
| cornerRadii:CGSizeMake(5, 5)]; | |
| CAShapeLayer *maskLayer = [CAShapeLayer layer]; | |
| maskLayer.frame = topicView.bounds; | |
| maskLayer.path = bezierPath.CGPath; | |
| topicView.layer.mask = maskLayer; | |
| UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, ScreenWidth - 10, 44) |
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([self.delegate respondsToSelector:@selector(call:type:)]) { | |
| [self.delegate call:sender type:type]; | |
| } |
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
| go build -ldflags "-H windowsgui" |
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
| private Bitmap decodeFile(File f) { | |
| try { | |
| // Decode image size | |
| BitmapFactory.Options o = new BitmapFactory.Options(); | |
| o.inJustDecodeBounds = true; | |
| BitmapFactory.decodeStream(new FileInputStream(f), null, o); | |
| // The new size we want to scale to | |
| final int REQUIRED_SIZE=70; |
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
| // | |
| // Macros.swift | |
| // | |
| // Created by Xavier Muñiz on 6/12/14. | |
| import Foundation | |
| // dLog and aLog macros to abbreviate NSLog. | |
| // Use like this: |
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)setLineSpacing:(CGFloat)spacing label:(UILabel *)label | |
| { | |
| NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:label.text]; | |
| NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init]; | |
| [paragraphStyle setLineSpacing:spacing]; | |
| [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [label.text length])]; | |
| [label setAttributedText:attributedString]; | |
| [label sizeToFit]; | |
| } |
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/bin/env bash | |
| rm -rf "${HOME}/Library/Caches/CocoaPods" | |
| rm -rf "`pwd`/Pods/" | |
| pod update |
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)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { | |
| [super touchesBegan:touches withEvent:event]; | |
| [self setBackgroundColor:[UIColor colorWithRed:227/255.0 green:227/255.0 blue:227/255.0 alpha:1.0]]; | |
| } | |
| - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { | |
| [super touchesEnded:touches withEvent:event]; | |
| [self setBackgroundColor:[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0]]; | |
| } | |
| - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { | |
| [super touchesCancelled:touches withEvent:event]; |