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
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |
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
// 设置行间距 | |
- (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 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 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 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 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 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 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 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 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
/* | |
* Copyright (C) 2013 Square, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |